From 763c852812c8c7e819881a76a237b6f19920f803 Mon Sep 17 00:00:00 2001 From: Thomas Vigouroux Date: Wed, 23 Sep 2020 22:45:51 +0200 Subject: undo: reduce reliance on curbuf --- src/nvim/ex_getln.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/nvim/ex_getln.c') 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). -- cgit From b35fefc57ff408246a4652c92d6ef0dbf36d529c Mon Sep 17 00:00:00 2001 From: Thomas Vigouroux Date: Thu, 8 Jul 2021 07:51:41 +0200 Subject: refactor: remove all mentions to `curbuf_lock` --- src/nvim/ex_getln.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/nvim/ex_getln.c') diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c index 2dfe2950fc..4ebd384ae0 100644 --- a/src/nvim/ex_getln.c +++ b/src/nvim/ex_getln.c @@ -2412,8 +2412,8 @@ 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->b_ro_locked > 0) { -- cgit