diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2018-12-01 02:41:31 +0100 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2018-12-01 16:06:01 +0100 |
commit | 0f00f31cbd9b13b41a0d3d976d192bbbeac9cbe8 (patch) | |
tree | 5b360b1cb235501364a80b53a460ed5da4f013c3 /test/functional/eval/input_spec.lua | |
parent | feec926633e317577b0a3a63cc0fb352c0ba77b8 (diff) | |
download | rneovim-0f00f31cbd9b13b41a0d3d976d192bbbeac9cbe8.tar.gz rneovim-0f00f31cbd9b13b41a0d3d976d192bbbeac9cbe8.tar.bz2 rneovim-0f00f31cbd9b13b41a0d3d976d192bbbeac9cbe8.zip |
VimL/confirm(): Show dialog even if :silent
closes #8788
related #9034
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) |