diff options
Diffstat (limited to 'test/functional/eval/input_spec.lua')
-rw-r--r-- | test/functional/eval/input_spec.lua | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/test/functional/eval/input_spec.lua b/test/functional/eval/input_spec.lua index 8c65297ac6..e774b939f7 100644 --- a/test/functional/eval/input_spec.lua +++ b/test/functional/eval/input_spec.lua @@ -8,6 +8,7 @@ local clear = helpers.clear local source = helpers.source local command = helpers.command local exc_exec = helpers.exc_exec +local nvim_async = helpers.nvim_async local screen @@ -59,6 +60,7 @@ before_each(function() RBP3={background=Screen.colors.Green}, RBP4={background=Screen.colors.Blue}, SEP={bold = true, reverse = true}, + CONFIRM={bold = true, foreground = Screen.colors.SeaGreen4}, }) end) @@ -439,3 +441,43 @@ describe('inputdialog()', function() ]]) end) end) + +describe('confirm()', function() + it("shows dialog even if :silent #8788", function() + command("autocmd BufNewFile * call confirm('test')") + + local function check_and_clear(edit_line) + screen:expect([[ + | + {SEP: }| + ]]..edit_line..[[ + {CONFIRM:test} | + {CONFIRM:[O]k: }^ | + ]]) + feed('<cr>') + command('redraw') + command('bdelete!') + end + + -- With shortmess-=F + command('set shortmess-=F') + feed(':edit foo<cr>') + check_and_clear('"foo" [New File] |\n') + + -- With shortmess+=F + command('set shortmess+=F') + feed(':edit foo<cr>') + check_and_clear(':edit foo |\n') + + -- With :silent + feed(':silent edit foo<cr>') + check_and_clear(':silent edit foo |\n') + + -- With API (via eval/VimL) call and shortmess+=F + feed(':call nvim_command("edit x")<cr>') + check_and_clear(':call nvim_command("edit |\n') + + nvim_async('command', 'edit x') + check_and_clear(' |\n') + end) +end) |