Lines Matching refs:curbuf
224 curbuf->b_no_eol_lnum = 0; // in case it was set by the previous read in readfile()
232 if (curbuf->b_ffname == NULL in readfile()
246 old_curbuf = curbuf; in readfile()
247 old_b_ffname = curbuf->b_ffname; in readfile()
248 old_b_fname = curbuf->b_fname; in readfile()
249 using_b_ffname = (fname == curbuf->b_ffname) in readfile()
250 || (sfname == curbuf->b_ffname); in readfile()
251 using_b_fname = (fname == curbuf->b_fname) || (sfname == curbuf->b_fname); in readfile()
278 orig_start = curbuf->b_op_start; in readfile()
281 curbuf->b_op_start.lnum = ((from == 0) ? 1 : from); in readfile()
282 curbuf->b_op_start.col = 0; in readfile()
287 FALSE, curbuf, eap)) in readfile()
300 curbuf->b_flags &= ~BF_NOTEDITED; in readfile()
312 curbuf->b_op_start = orig_start; in readfile()
315 if ((shortmess(SHM_OVER) || curbuf->b_help) && p_verbose == 0) in readfile()
327 filemess(curbuf, fname, (char_u *)_("Illegal file name"), 0); in readfile()
338 filemess(curbuf, fname, (char_u *)_(msg_is_a_directory), 0); in readfile()
366 filemess(curbuf, fname, (char_u *)_(msg_is_a_directory), 0); in readfile()
370 filemess(curbuf, fname, (char_u *)_("is not a file"), 0); in readfile()
383 filemess(curbuf, fname, (char_u *)_("is a device (disabled with 'opendevice' option)"), 0); in readfile()
400 check_readonly = (newfile && (curbuf->b_flags & BF_CHECK_RO)); in readfile()
402 curbuf->b_p_ro = FALSE; in readfile()
409 buf_store_time(curbuf, &st, fname); in readfile()
410 curbuf->b_mtime_read = curbuf->b_mtime; in readfile()
411 curbuf->b_mtime_read_ns = curbuf->b_mtime_ns; in readfile()
428 curbuf->b_fab_rfm = st.st_fab_rfm; in readfile()
429 curbuf->b_fab_rat = st.st_fab_rat; in readfile()
430 curbuf->b_fab_mrs = st.st_fab_mrs; in readfile()
435 curbuf->b_mtime = 0; in readfile()
436 curbuf->b_mtime_ns = 0; in readfile()
437 curbuf->b_mtime_read = 0; in readfile()
438 curbuf->b_mtime_read_ns = 0; in readfile()
439 curbuf->b_orig_size = 0; in readfile()
440 curbuf->b_orig_mode = 0; in readfile()
445 curbuf->b_flags &= ~(BF_NEW | BF_NEW_W); in readfile()
496 filemess(curbuf, sfname, (char_u *)_(msg_is_a_directory), 0); in readfile()
497 curbuf->b_p_ro = TRUE; // must use "w!" now in readfile()
513 curbuf->b_flags |= BF_NEW; in readfile()
519 if (!bt_dontwrite(curbuf)) in readfile()
524 if (curbuf != old_curbuf in readfile()
526 && (old_b_ffname != curbuf->b_ffname)) in readfile()
528 && (old_b_fname != curbuf->b_fname))) in readfile()
535 filemess(curbuf, sfname, in readfile()
538 filemess(curbuf, sfname, in readfile()
549 FALSE, curbuf, eap); in readfile()
551 save_file_ff(curbuf); in readfile()
561 filemess(curbuf, sfname, (char_u *)( in readfile()
569 curbuf->b_p_ro = TRUE; // must use "w!" now in readfile()
580 if ((check_readonly && file_readonly) || curbuf->b_help) in readfile()
581 curbuf->b_p_ro = TRUE; in readfile()
589 curbuf->b_p_eol = TRUE; in readfile()
590 curbuf->b_start_eol = TRUE; in readfile()
592 curbuf->b_p_bomb = FALSE; in readfile()
593 curbuf->b_start_bomb = FALSE; in readfile()
600 if (!bt_dontwrite(curbuf)) in readfile()
604 if (!read_stdin && (curbuf != old_curbuf in readfile()
605 || (using_b_ffname && (old_b_ffname != curbuf->b_ffname)) in readfile()
606 || (using_b_fname && (old_b_fname != curbuf->b_fname)))) in readfile()
615 if (swap_mode > 0 && curbuf->b_ml.ml_mfp != NULL in readfile()
616 && curbuf->b_ml.ml_mfp->mf_fname != NULL) in readfile()
618 char_u *swap_fname = curbuf->b_ml.ml_mfp->mf_fname; in readfile()
634 && fchown(curbuf->b_ml.ml_mfp->mf_fd, -1, st.st_gid) in readfile()
659 orig_start = curbuf->b_op_start; in readfile()
660 curbuf->b_op_start.lnum = ((from == 0) ? 1 : from); in readfile()
661 curbuf->b_op_start.col = 0; in readfile()
687 FALSE, curbuf, eap); in readfile()
690 FALSE, curbuf, eap); in readfile()
693 FALSE, curbuf, eap); in readfile()
701 curbuf->b_op_start = orig_start; in readfile()
711 curbuf->b_p_ro = TRUE; // must use "w!" now in readfile()
722 if (!read_stdin && (curbuf != old_curbuf in readfile()
723 || (using_b_ffname && (old_b_ffname != curbuf->b_ffname)) in readfile()
724 || (using_b_fname && (old_b_fname != curbuf->b_fname)) in readfile()
733 curbuf->b_p_ro = TRUE; // must use "w!" now in readfile()
739 wasempty = (curbuf->b_ml.ml_flags & ML_EMPTY); in readfile()
770 filemess(curbuf, sfname, (char_u *)"", 0); in readfile()
779 linecnt = curbuf->b_ml.ml_line_count; in readfile()
786 curbuf->b_bad_char = eap->bad_char; in readfile()
789 curbuf->b_bad_char = 0; in readfile()
800 else if (curbuf->b_p_bin) in readfile()
805 else if (curbuf->b_help) in readfile()
851 fenc = curbuf->b_p_fenc; // use format from buffer in readfile()
900 curbuf->b_p_bomb = FALSE; in readfile()
901 curbuf->b_start_bomb = FALSE; in readfile()
916 fileformat = get_fileformat_force(curbuf, eap); in readfile()
919 else if (curbuf->b_p_bin) in readfile()
922 fileformat = get_fileformat(curbuf);// use format from buffer in readfile()
1096 && curbuf->b_ffname != NULL in readfile()
1097 && curbuf->b_p_udf in readfile()
1106 if (curbuf->b_cryptstate != NULL) in readfile()
1110 crypt_free_state(curbuf->b_cryptstate); in readfile()
1111 curbuf->b_cryptstate = NULL; in readfile()
1261 if (!curbuf->b_p_eol) in readfile()
1284 else if (filesize > 0 && (curbuf->b_cryptstate != NULL && in readfile()
1285 curbuf->b_cryptstate->method_nr == CRYPT_M_SOD)) in readfile()
1305 if (curbuf->b_cryptstate != NULL in readfile()
1306 && !crypt_works_inplace(curbuf->b_cryptstate)) in readfile()
1315 if (cryptkey != NULL && curbuf->b_cryptstate != NULL in readfile()
1319 if (crypt_works_inplace(curbuf->b_cryptstate)) in readfile()
1322 crypt_decode_inplace(curbuf->b_cryptstate, ptr, in readfile()
1332 curbuf->b_cryptstate, ptr, size, in readfile()
1410 conv_error = curbuf->b_ml.ml_line_count in readfile()
1415 illegal_byte = curbuf->b_ml.ml_line_count in readfile()
1464 crypt_get_method_nr(curbuf))) in readfile()
1468 || (!curbuf->b_p_bomb in readfile()
1476 if (size < 2 || curbuf->b_p_bin) in readfile()
1489 curbuf->b_p_bomb = TRUE; in readfile()
1490 curbuf->b_start_bomb = TRUE; in readfile()
1987 else if (enc_utf8 && !curbuf->b_p_bin) in readfile()
2276 && !(!curbuf->b_p_bin in readfile()
2283 curbuf->b_p_eol = FALSE; in readfile()
2299 save_file_ff(curbuf); // remember the current file format in readfile()
2302 if (curbuf->b_cryptstate != NULL) in readfile()
2304 crypt_free_state(curbuf->b_cryptstate); in readfile()
2305 curbuf->b_cryptstate = NULL; in readfile()
2307 if (cryptkey != NULL && cryptkey != curbuf->b_p_key) in readfile()
2360 if (newfile && wasempty && !(curbuf->b_ml.ml_flags & ML_EMPTY)) in readfile()
2365 ml_delete(curbuf->b_ml.ml_line_count); in readfile()
2371 linecnt = curbuf->b_ml.ml_line_count - linecnt; in readfile()
2380 diff_invalidate(curbuf); in readfile()
2409 filemess(curbuf, sfname, (char_u *)_(e_interr), 0); in readfile()
2411 curbuf->b_p_ro = TRUE; // must use "w!" now in readfile()
2422 msg_add_fname(curbuf, sfname); // fname in IObuff with quotes in readfile()
2444 if (curbuf->b_p_ro) in readfile()
2477 crypt_append_msg(curbuf); in readfile()
2503 - crypt_get_header_len(crypt_get_method_nr(curbuf))); in readfile()
2538 curbuf->b_p_ro = TRUE; in readfile()
2556 curbuf->b_op_start.lnum = from + 1; in readfile()
2557 curbuf->b_op_start.col = 0; in readfile()
2558 curbuf->b_op_end.lnum = from + linecnt; in readfile()
2559 curbuf->b_op_end.col = 0; in readfile()
2573 buf_store_time(curbuf, &st, fname); in readfile()
2574 curbuf->b_mtime_read = curbuf->b_mtime; in readfile()
2575 curbuf->b_mtime_read_ns = curbuf->b_mtime_ns; in readfile()
2594 curbuf->b_no_eol_lnum = read_no_eol_lnum; in readfile()
2622 save_file_ff(curbuf); in readfile()
2632 FALSE, curbuf, eap); in readfile()
2636 FALSE, curbuf, eap); in readfile()
2637 if (!au_did_filetype && *curbuf->b_p_ft != NUL) in readfile()
2642 apply_autocmds(EVENT_FILETYPE, curbuf->b_p_ft, curbuf->b_fname, in readfile()
2643 TRUE, curbuf); in readfile()
2693 lnum = curbuf->b_ml.ml_line_count - linecnt + 1; in readfile_linenr()
2733 set_fileformat(get_fileformat_force(curbuf, eap), OPT_LOCAL); in set_file_options()
2741 int oldval = curbuf->b_p_bin; in set_file_options()
2743 curbuf->b_p_bin = (eap->force_bin == FORCE_BIN); in set_file_options()
2744 set_options_bin(oldval, curbuf->b_p_bin, OPT_LOCAL); in set_file_options()
2884 int b_p_ro = curbuf->b_p_ro; in check_for_cryptkey()
2890 curbuf->b_p_ro = TRUE; in check_for_cryptkey()
2893 crypt_set_cm_option(curbuf, method); in check_for_cryptkey()
2896 if (*curbuf->b_p_key) in check_for_cryptkey()
2897 cryptkey = curbuf->b_p_key; in check_for_cryptkey()
2913 if (cryptkey != curbuf->b_p_key) in check_for_cryptkey()
2929 curbuf->b_cryptstate = crypt_create_from_header( in check_for_cryptkey()
2931 crypt_set_cm_option(curbuf, method); in check_for_cryptkey()
2939 curbuf->b_p_ro = b_p_ro; in check_for_cryptkey()
2944 else if (newfile && *curbuf->b_p_key != NUL && !starting) in check_for_cryptkey()
3002 buf_T *buf = curbuf; in set_rw_fname()
3005 if (curbuf->b_p_bl) in set_rw_fname()
3006 apply_autocmds(EVENT_BUFDELETE, NULL, NULL, FALSE, curbuf); in set_rw_fname()
3007 apply_autocmds(EVENT_BUFWIPEOUT, NULL, NULL, FALSE, curbuf); in set_rw_fname()
3012 if (curbuf != buf) in set_rw_fname()
3019 if (setfname(curbuf, fname, sfname, FALSE) == OK) in set_rw_fname()
3020 curbuf->b_flags |= BF_NOTEDITED; in set_rw_fname()
3023 apply_autocmds(EVENT_BUFNEW, NULL, NULL, FALSE, curbuf); in set_rw_fname()
3024 if (curbuf->b_p_bl) in set_rw_fname()
3025 apply_autocmds(EVENT_BUFADD, NULL, NULL, FALSE, curbuf); in set_rw_fname()
3032 if (*curbuf->b_p_ft == NUL) in set_rw_fname()
3503 return buf_modname((curbuf->b_p_sn || curbuf->b_shortname), in modname()
3988 buf_T *tbuf = curbuf; in move_lines()
3994 curbuf = tobuf; in move_lines()
4010 curbuf = frombuf; in move_lines()
4011 for (lnum = curbuf->b_ml.ml_line_count; lnum > 0; --lnum) in move_lines()
4021 curbuf = tbuf; in move_lines()
4299 buf_T *save_curbuf = curbuf; in buf_check_timestamp()
4302 curbuf = buf; in buf_check_timestamp()
4305 curbuf = save_curbuf; in buf_check_timestamp()
4353 if (p_ur < 0 || curbuf->b_ml.ml_line_count <= p_ur) in buf_reload()
4358 saved = u_savecommon(0, curbuf->b_ml.ml_line_count + 1, 0, TRUE); in buf_reload()
4376 if (savebuf != NULL && buf == curbuf) in buf_reload()
4379 curbuf = savebuf; in buf_reload()
4381 saved = ml_open(curbuf); in buf_reload()
4382 curbuf = buf; in buf_reload()
4385 if (savebuf == NULL || saved == FAIL || buf != curbuf in buf_reload()
4396 curbuf->b_flags |= BF_CHECK_RO; // check for RO again in buf_reload()
4406 if (savebuf != NULL && bufref_valid(&bufref) && buf == curbuf) in buf_reload()
4416 else if (buf == curbuf) // "buf" still valid in buf_reload()
4428 u_unchanged(curbuf); in buf_reload()
4439 diff_invalidate(curbuf); in buf_reload()
4444 if (old_topline > curbuf->b_ml.ml_line_count) in buf_reload()
4445 curwin->w_topline = curbuf->b_ml.ml_line_count; in buf_reload()
4467 if (orig_mode == curbuf->b_orig_mode) in buf_reload()
4468 curbuf->b_p_ro |= old_ro; in buf_reload()
4503 if (curbuf->b_no_eol_lnum != 0) // only if there is a missing eol in write_lnum_adjust()
4504 curbuf->b_no_eol_lnum += offset; in write_lnum_adjust()