diff options
author | James McCoy <jamessan@jamessan.com> | 2017-10-12 00:49:47 -0400 |
---|---|---|
committer | James McCoy <jamessan@jamessan.com> | 2017-10-14 14:32:27 -0400 |
commit | dc513f761897f0ea09a511d19254f5c10b68e7fa (patch) | |
tree | 078ca8fbaf59d800acc18a9dd7fea2749c48f20e | |
parent | 77f1392f073660558d8772cfab8be8cf7c2f8b7f (diff) | |
download | rneovim-dc513f761897f0ea09a511d19254f5c10b68e7fa.tar.gz rneovim-dc513f761897f0ea09a511d19254f5c10b68e7fa.tar.bz2 rneovim-dc513f761897f0ea09a511d19254f5c10b68e7fa.zip |
getcmdline_prompt: Temporarily disable msg_silent so prompt is displayed
vim-patch:7.4.1636
Closes #7378
-rw-r--r-- | src/nvim/ex_getln.c | 4 | ||||
-rw-r--r-- | test/functional/eval/input_spec.lua | 19 |
2 files changed, 23 insertions, 0 deletions
diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c index fd7ad7a4b5..80f9b47340 100644 --- a/src/nvim/ex_getln.c +++ b/src/nvim/ex_getln.c @@ -1863,9 +1863,13 @@ char *getcmdline_prompt(const char firstc, const char *const prompt, ccline.input_fn = (firstc == '@'); ccline.highlight_callback = highlight_callback; + int msg_silent_saved = msg_silent; + msg_silent = 0; + char *const ret = (char *)getcmdline(firstc, 1L, 0); restore_cmdline(&save_ccline); + msg_silent = msg_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, diff --git a/test/functional/eval/input_spec.lua b/test/functional/eval/input_spec.lua index 5ae23e17d0..1e6b107c60 100644 --- a/test/functional/eval/input_spec.lua +++ b/test/functional/eval/input_spec.lua @@ -239,6 +239,25 @@ describe('input()', function() {RBP1:(}{RBP2:()}{RBP1:)}^ | ]]) end) + it('is not hidden by :silent', function() + feed([[:silent call input('Foo: ')<CR>]]) + screen:expect([[ + {EOB:~ }| + {EOB:~ }| + {EOB:~ }| + Foo: ^ | + | + ]]) + feed('Bar') + screen:expect([[ + {EOB:~ }| + {EOB:~ }| + {EOB:~ }| + Foo: Bar^ | + | + ]]) + feed('<CR>') + end) end) describe('inputdialog()', function() it('works with multiline prompts', function() |