diff options
author | Thomas Vigouroux <tomvig38@gmail.com> | 2020-09-23 22:45:51 +0200 |
---|---|---|
committer | Thomas Vigouroux <tomvig38@gmail.com> | 2021-07-06 19:08:32 +0200 |
commit | 763c852812c8c7e819881a76a237b6f19920f803 (patch) | |
tree | a2892e9cf4e89e5f58ed4870bf40af3f816f33f7 /src/nvim/ex_getln.c | |
parent | 55a2c513aafb386c01259fca711b2e0f9b85e359 (diff) | |
download | rneovim-763c852812c8c7e819881a76a237b6f19920f803.tar.gz rneovim-763c852812c8c7e819881a76a237b6f19920f803.tar.bz2 rneovim-763c852812c8c7e819881a76a237b6f19920f803.zip |
undo: reduce reliance on curbuf
Diffstat (limited to 'src/nvim/ex_getln.c')
-rw-r--r-- | src/nvim/ex_getln.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c index f63987136f..2dfe2950fc 100644 --- a/src/nvim/ex_getln.c +++ b/src/nvim/ex_getln.c @@ -2412,13 +2412,11 @@ char_u * get_text_locked_msg(void) { } } -/* - * Check if "curbuf_lock" or "allbuf_lock" is set and return TRUE when it is - * and give an error message. - */ +/// Check if "curbuf_lock" or "allbuf_lock" is set and return TRUE when it is +/// and give an error message. int curbuf_locked(void) { - if (curbuf_lock > 0) { + if (curbuf->b_ro_locked > 0) { EMSG(_("E788: Not allowed to edit another buffer now")); return TRUE; } @@ -6513,7 +6511,7 @@ static int open_cmdwin(void) curwin->w_p_fen = false; // Don't allow switching to another buffer. - curbuf_lock++; + curbuf->b_ro_locked++; // Showing the prompt may have set need_wait_return, reset it. need_wait_return = false; @@ -6526,7 +6524,7 @@ static int open_cmdwin(void) } set_option_value("ft", 0L, "vim", OPT_LOCAL); } - curbuf_lock--; + curbuf->b_ro_locked--; // Reset 'textwidth' after setting 'filetype' (the Vim filetype plugin // sets 'textwidth' to 78). |