aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/cmdline_highlight_spec.lua
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2017-06-28 22:54:13 +0300
committerZyX <kp-pav@yandex.ru>2017-06-28 22:54:13 +0300
commitea75966e4232dc4a3693cbc4a572f2116c49b138 (patch)
tree69948babb830942aa5347a221db8630dea17f650 /test/functional/ui/cmdline_highlight_spec.lua
parent564d5f921c837e278f7e1aefeb7d832d08a63e97 (diff)
downloadrneovim-ea75966e4232dc4a3693cbc4a572f2116c49b138.tar.gz
rneovim-ea75966e4232dc4a3693cbc4a572f2116c49b138.tar.bz2
rneovim-ea75966e4232dc4a3693cbc4a572f2116c49b138.zip
ex_getln: Do not make <C-c> interrupt input() after interrupting hl cb
Diffstat (limited to 'test/functional/ui/cmdline_highlight_spec.lua')
-rw-r--r--test/functional/ui/cmdline_highlight_spec.lua42
1 files changed, 28 insertions, 14 deletions
diff --git a/test/functional/ui/cmdline_highlight_spec.lua b/test/functional/ui/cmdline_highlight_spec.lua
index dbabf65b68..671490e668 100644
--- a/test/functional/ui/cmdline_highlight_spec.lua
+++ b/test/functional/ui/cmdline_highlight_spec.lua
@@ -10,6 +10,13 @@ local source = helpers.source
local screen
+-- Bug in input() handling: {REDRAW} will erase the whole prompt up until
+-- user types something. It exists in Vim as well, so using `h<BS>` as
+-- a workaround.
+local function redraw_input()
+ feed('{REDRAW}h<BS>')
+end
+
before_each(function()
clear()
screen = Screen.new(40, 8)
@@ -214,10 +221,7 @@ describe('Command-line coloring', function()
{EOB:~ }|
:echo {RBP1:(}{RBP2:(}42{RBP2:)}^ |
]])
- -- Bug in input() handling: {REDRAW} will erase the whole prompt up until
- -- user types something. It exists in Vim as well, so using `h<BS>` as
- -- a workaround.
- feed('{REDRAW}h<BS>')
+ redraw_input()
screen:expect([[
|
{EOB:~ }|
@@ -364,24 +368,33 @@ describe('Command-line coloring', function()
: |
{ERR:E5407: Callback has thrown an exception:}|
{ERR: Keyboard interrupt} |
- ^ |
+ :echo 42^ |
]])
- if true then return pending('<C-c> should only cancel callback, not input()') end
- feed('{REDRAW}')
- screen:snapshot_util()
- feed('<CR>')
- eq('echo 42', meths.get_var('out'))
+ redraw_input()
screen:expect([[
- ^ |
+ |
{EOB:~ }|
{EOB:~ }|
{EOB:~ }|
{EOB:~ }|
{EOB:~ }|
{EOB:~ }|
- Type :quit<Enter> to exit Nvim |
+ :echo 42^ |
]])
- start_prompt('echo 42<CR>')
+ feed('\n')
+ screen:expect([[
+ |
+ {EOB:~ }|
+ {EOB:~ }|
+ {EOB:~ }|
+ {EOB:~ }|
+ {EOB:~ }|
+ {EOB:~ }|
+ ^:echo 42 |
+ ]])
+ feed('\n')
+ eq('echo 42', meths.get_var('out'))
+ feed('<C-c>')
screen:expect([[
^ |
{EOB:~ }|
@@ -390,7 +403,7 @@ describe('Command-line coloring', function()
{EOB:~ }|
{EOB:~ }|
{EOB:~ }|
- 42 |
+ Type :quit<Enter> to exit Nvim |
]])
end)
it('works fine with NUL, NL, CR', function()
@@ -420,3 +433,4 @@ describe('Ex commands coloring support', function()
end)
-- TODO Specifically test for coloring in cmdline and expr modes
+-- TODO Check using highlighted input() from inside highlighted input()