summaryrefslogtreecommitdiff
path: root/src/ex_getln.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-04-29 22:30:13 +0200
committerBram Moolenaar <Bram@vim.org>2020-04-29 22:30:13 +0200
commitdfc33a665d3b12689aa971575b8e7de4e5202d83 (patch)
tree8c046a483c6b78d558f9ad178ed7e9369c4efe5c /src/ex_getln.c
parent339d60c89bef0315343a6128a1b4826510b0efe4 (diff)
downloadvim-git-dfc33a665d3b12689aa971575b8e7de4e5202d83.tar.gz
patch 8.2.0662: cannot use input() in a channel callbackv8.2.0662
Problem: Cannot use input() in a channel callback. Solution: Reset vgetc_busy. (closes #6010)
Diffstat (limited to 'src/ex_getln.c')
-rw-r--r--src/ex_getln.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/ex_getln.c b/src/ex_getln.c
index 7e92ec899..6376a5fba 100644
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -4468,6 +4468,8 @@ get_user_input(
rettv->v_type = VAR_STRING;
rettv->vval.v_string = NULL;
+ if (input_busy)
+ return; // this doesn't work recursively.
#ifdef NO_CONSOLE_INPUT
// While starting up, there is no place to enter text. When running tests
@@ -4528,12 +4530,18 @@ get_user_input(
if (defstr != NULL)
{
int save_ex_normal_busy = ex_normal_busy;
+ int save_vgetc_busy = vgetc_busy;
+ int save_input_busy = input_busy;
+ input_busy |= vgetc_busy;
ex_normal_busy = 0;
+ vgetc_busy = 0;
rettv->vval.v_string =
getcmdline_prompt(secret ? NUL : '@', p, get_echo_attr(),
xp_type, xp_arg);
ex_normal_busy = save_ex_normal_busy;
+ vgetc_busy = save_vgetc_busy;
+ input_busy = save_input_busy;
}
if (inputdialog && rettv->vval.v_string == NULL
&& argvars[1].v_type != VAR_UNKNOWN