aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/cmdline_highlight_spec.lua
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2017-07-18 00:08:57 +0300
committerZyX <kp-pav@yandex.ru>2017-07-18 00:08:57 +0300
commitcfb1d937a64fcec836fdf26d6ea67024aeafabeb (patch)
treefb2959cef61224433c5ad2204f23e818b336ccd4 /test/functional/ui/cmdline_highlight_spec.lua
parent3a923ad2db87b2bece89616b28a14ab9826d569a (diff)
downloadrneovim-cfb1d937a64fcec836fdf26d6ea67024aeafabeb.tar.gz
rneovim-cfb1d937a64fcec836fdf26d6ea67024aeafabeb.tar.bz2
rneovim-cfb1d937a64fcec836fdf26d6ea67024aeafabeb.zip
api helpers: Also save and restore did_emsg
Diffstat (limited to 'test/functional/ui/cmdline_highlight_spec.lua')
-rw-r--r--test/functional/ui/cmdline_highlight_spec.lua38
1 files changed, 38 insertions, 0 deletions
diff --git a/test/functional/ui/cmdline_highlight_spec.lua b/test/functional/ui/cmdline_highlight_spec.lua
index 0621b990de..6698ced596 100644
--- a/test/functional/ui/cmdline_highlight_spec.lua
+++ b/test/functional/ui/cmdline_highlight_spec.lua
@@ -489,6 +489,44 @@ describe('Ex commands coloring support', function()
|
]])
end)
+ it('does not prevent mapping error from cancelling prompt', function()
+ meths.command("cnoremap <expr> x execute('throw 42')[-1]")
+ feed(':#x')
+ screen:expect([[
+ {EOB:~ }|
+ {EOB:~ }|
+ {EOB:~ }|
+ {EOB:~ }|
+ :# |
+ {ERR:Error detected while processing :} |
+ {ERR:E605: Exception not caught: 42} |
+ :#^ |
+ ]])
+ feed('<CR>')
+ screen:expect([[
+ ^ |
+ {EOB:~ }|
+ {EOB:~ }|
+ {EOB:~ }|
+ {EOB:~ }|
+ {EOB:~ }|
+ {EOB:~ }|
+ |
+ ]])
+ feed('<CR>')
+ screen:expect([[
+ ^ |
+ {EOB:~ }|
+ {EOB:~ }|
+ {EOB:~ }|
+ {EOB:~ }|
+ {EOB:~ }|
+ {EOB:~ }|
+ |
+ ]])
+ eq('\nError detected while processing :\nE605: Exception not caught: 42',
+ meths.command_output('messages'))
+ end)
end)
-- TODO Specifically test for coloring in cmdline and expr modes