getcmdline_prompt: Temporarily disable msg_silent so prompt is displayed

vim-patch:7.4.1636
Closes #7378
This commit is contained in:
James McCoy 2017-10-12 00:49:47 -04:00
parent 77f1392f07
commit dc513f7618
No known key found for this signature in database
GPG Key ID: DFE691AE331BA3DB
2 changed files with 23 additions and 0 deletions

View File

@ -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,

View File

@ -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()