summaryrefslogtreecommitdiffstats
path: root/src/ex_getln.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-05-27 17:26:55 +0100
committerBram Moolenaar <Bram@vim.org>2022-05-27 17:26:55 +0100
commitcfe456543e840d133399551f8626d985e1fb1958 (patch)
tree88e1820132eef74ed7abab2334d51019cb6f47d2 /src/ex_getln.c
parent02e8d4e4ffcdd6ee919e19692d591da8e18a565d (diff)
patch 8.2.5029: "textlock" is always zerov8.2.5029
Problem: "textlock" is always zero. Solution: Remove "textlock" and rename "textwinlock" to "textlock". (closes #10489)
Diffstat (limited to 'src/ex_getln.c')
-rw-r--r--src/ex_getln.c30
1 files changed, 9 insertions, 21 deletions
diff --git a/src/ex_getln.c b/src/ex_getln.c
index 6462b00f73..9dadfbf2fa 100644
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -850,12 +850,12 @@ cmdline_handle_backslash_key(int c, int *gotesc)
c = get_expr_register();
if (c == '=')
{
- // Need to save and restore ccline. And set "textwinlock"
+ // Need to save and restore ccline. And set "textlock"
// to avoid nasty things like going to another buffer when
// evaluating an expression.
- ++textwinlock;
+ ++textlock;
p = get_expr_line();
- --textwinlock;
+ --textlock;
if (p != NULL)
{
@@ -2710,13 +2710,13 @@ check_opt_wim(void)
* 'balloonexpr', etc.
*/
int
-text_and_win_locked(void)
+text_locked(void)
{
#ifdef FEAT_CMDWIN
if (cmdwin_type != 0)
return TRUE;
#endif
- return textwinlock != 0;
+ return textlock != 0;
}
/*
@@ -2736,19 +2736,7 @@ get_text_locked_msg(void)
if (cmdwin_type != 0)
return e_invalid_in_cmdline_window;
#endif
- if (textwinlock != 0)
- return e_not_allowed_to_change_text_or_change_window;
- return e_not_allowed_to_change_text_here;
-}
-
-/*
- * Return TRUE when the text must not be changed and/or we cannot switch to
- * another window. TRUE while evaluating 'completefunc'.
- */
- int
-text_locked(void)
-{
- return text_and_win_locked() || textlock != 0;
+ return e_not_allowed_to_change_text_or_change_window;
}
/*
@@ -3730,11 +3718,11 @@ cmdline_paste(
regname = may_get_selection(regname);
#endif
- // Need to set "textwinlock" to avoid nasty things like going to another
+ // Need to set "textlock" to avoid nasty things like going to another
// buffer when evaluating an expression.
- ++textwinlock;
+ ++textlock;
i = get_spec_reg(regname, &arg, &allocated, TRUE);
- --textwinlock;
+ --textlock;
if (i)
{