aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_getln.c
diff options
context:
space:
mode:
authorluukvbaal <luukvbaal@gmail.com>2025-01-05 14:59:50 +0100
committerGitHub <noreply@github.com>2025-01-05 05:59:50 -0800
commit847c28f6f6ccdfa6d7887605b84137e00e5f7968 (patch)
tree5a0e14fd8c16db6b3e1c2ac2f7effd756277d147 /src/nvim/ex_getln.c
parentbf48dfadeccc37527e9b59b1c0f529ea889bf735 (diff)
downloadrneovim-847c28f6f6ccdfa6d7887605b84137e00e5f7968.tar.gz
rneovim-847c28f6f6ccdfa6d7887605b84137e00e5f7968.tar.bz2
rneovim-847c28f6f6ccdfa6d7887605b84137e00e5f7968.zip
fix(cmdline): always show cmdline when it is a prompt #31866
Cmdline prompts should ignore `cmd_silent`.
Diffstat (limited to 'src/nvim/ex_getln.c')
-rw-r--r--src/nvim/ex_getln.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c
index 09006484ca..b26a2ef1bc 100644
--- a/src/nvim/ex_getln.c
+++ b/src/nvim/ex_getln.c
@@ -2815,8 +2815,10 @@ char *getcmdline_prompt(const int firstc, const char *const prompt, const int hl
ccline.one_key = one_key;
ccline.mouse_used = mouse_used;
+ const bool cmd_silent_saved = cmd_silent;
int msg_silent_saved = msg_silent;
msg_silent = 0;
+ cmd_silent = false; // Want to see the prompt.
char *const ret = (char *)command_line_enter(firstc, 1, 0, false);
ccline.redraw_state = kCmdRedrawNone;
@@ -2825,6 +2827,7 @@ char *getcmdline_prompt(const int firstc, const char *const prompt, const int hl
restore_cmdline(&save_ccline);
}
msg_silent = msg_silent_saved;
+ cmd_silent = cmd_silent_saved;
// Restore msg_col, the prompt from input() may have changed it.
// But only if called recursively and the commandline is therefore being
// restored to an old one; if not, the input() prompt stays on the screen,
@@ -4792,9 +4795,6 @@ void get_user_input(const typval_T *const argvars, typval_T *const rettv, const
}
}
- const bool cmd_silent_save = cmd_silent;
-
- cmd_silent = false; // Want to see the prompt.
// Only the part of the message after the last NL is considered as
// prompt for the command line, unlsess cmdline is externalized
const char *p = prompt;
@@ -4829,5 +4829,4 @@ void get_user_input(const typval_T *const argvars, typval_T *const rettv, const
// Since the user typed this, no need to wait for return.
need_wait_return = false;
msg_didout = false;
- cmd_silent = cmd_silent_save;
}