diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2017-08-20 17:47:42 +0200 |
---|---|---|
committer | Björn Linse <bjorn.linse@gmail.com> | 2017-10-26 20:29:08 +0200 |
commit | bed0a3a8428027af32602ccb169e81767c55e257 (patch) | |
tree | 6590bf7ca2de3ca26f8d068505e8f88d623a70ce /test/functional/ui | |
parent | 2050e6604632e190a04d52829f4469f1ef7f7018 (diff) | |
download | rneovim-bed0a3a8428027af32602ccb169e81767c55e257.tar.gz rneovim-bed0a3a8428027af32602ccb169e81767c55e257.tar.bz2 rneovim-bed0a3a8428027af32602ccb169e81767c55e257.zip |
ext_cmdline: implement redraw!
Diffstat (limited to 'test/functional/ui')
-rw-r--r-- | test/functional/ui/cmdline_spec.lua | 54 |
1 files changed, 43 insertions, 11 deletions
diff --git a/test/functional/ui/cmdline_spec.lua b/test/functional/ui/cmdline_spec.lua index 3f9ce8ad67..e4d625df8e 100644 --- a/test/functional/ui/cmdline_spec.lua +++ b/test/functional/ui/cmdline_spec.lua @@ -3,6 +3,7 @@ local Screen = require('test.functional.ui.screen') local clear, feed, eq = helpers.clear, helpers.feed, helpers.eq local source = helpers.source local ok = helpers.ok +local command = helpers.command if helpers.pending_win32(pending) then return end @@ -218,14 +219,7 @@ describe('external cmdline', function() end) feed('1+2') - screen:expect([[ - ^ | - ~ | - ~ | - ~ | - | - ]], nil, nil, function() - eq({{ + local expectation = {{ content = { { {}, "xx" } }, firstc = ":", indent = 0, @@ -238,16 +232,40 @@ describe('external cmdline', function() indent = 0, pos = 3, prompt = "", - }}, cmdline) + }} + screen:expect([[ + ^ | + ~ | + ~ | + ~ | + | + ]], nil, nil, function() + eq(expectation, cmdline) end) - feed('<cr>') + -- erase information, so we check if it is retransmitted + cmdline = {} + command("redraw!") + -- redraw! forgets cursor position. Be OK with that, as UI should indicate + -- focus is at external cmdline anyway. screen:expect([[ - ^ | + | ~ | ~ | ~ | + ^ | + ]], nil, nil, function() + eq(expectation, cmdline) + end) + + + feed('<cr>') + screen:expect([[ | + ~ | + ~ | + ~ | + ^ | ]], nil, nil, function() eq({{ content = { { {}, "xx3" } }, @@ -301,6 +319,20 @@ describe('external cmdline', function() {{{}, ' line1'}}}, block) end) + block = {} + command("redraw!") + screen:expect([[ + | + ~ | + ~ | + ~ | + ^ | + ]], nil, nil, function() + eq({{{{}, 'function Foo()'}}, + {{{}, ' line1'}}}, block) + end) + + feed('endfunction<cr>') screen:expect([[ ^ | |