aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_getln.c
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2021-07-09 10:15:18 +0200
committerGitHub <noreply@github.com>2021-07-09 10:15:18 +0200
commit1c416892879de6b78038f2cc2f1487eff46abb60 (patch)
tree3895521bc907b7a0617940c21272ac7ee9f052da /src/nvim/ex_getln.c
parent27118c6eb3351b0df96e2514e8f3806108e50cf7 (diff)
parent9c93e6461c8c6ec2e8d3e73f506389ac7086d531 (diff)
downloadrneovim-1c416892879de6b78038f2cc2f1487eff46abb60.tar.gz
rneovim-1c416892879de6b78038f2cc2f1487eff46abb60.tar.bz2
rneovim-1c416892879de6b78038f2cc2f1487eff46abb60.zip
Merge pull request #12971 from vigoux/decurbuf
Decrease reliance on curbuf in BUFEMPTY and `undo.c`
Diffstat (limited to 'src/nvim/ex_getln.c')
-rw-r--r--src/nvim/ex_getln.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c
index f63987136f..4ebd384ae0 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->b_ro_locked" 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).