aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2019-04-11 13:51:07 +0200
committerBjörn Linse <bjorn.linse@gmail.com>2019-05-14 12:54:39 +0200
commit5020daa6e5ced9235f5d11317c74f655a129803e (patch)
tree3de6f25bd1bf1579e84c88a3fa9829b395131bd6 /test
parentaa82f8b88fe82077740894dd387801384e0558b6 (diff)
downloadrneovim-5020daa6e5ced9235f5d11317c74f655a129803e.tar.gz
rneovim-5020daa6e5ced9235f5d11317c74f655a129803e.tar.bz2
rneovim-5020daa6e5ced9235f5d11317c74f655a129803e.zip
ui/terminal: make terminal state redraw like any other state
Previously, ordinary redraws were missing from terminal mode. Instead, there was an async callback that invoked update_screen() on terminal data regardless of mode (as if :redraw! was invoked by a timer). This created some issues: - async changes to an unrelated ordinary buffer were not always redrawn in terminal mode - screen cursor position was not properly updated in terminal mode (partial fix, will be properly fixed in a follow up PR) - ad-hoc logic was needed for interaction with special states such as inccommand or horizontal wildmenu. Instead redraw terminal mode just like any other state. This disables forced redraws in cmdline mode, which were inconisent which async changes to normal buffers (which are not redrawn in cmdline mode).
Diffstat (limited to 'test')
-rw-r--r--test/functional/terminal/scrollback_spec.lua12
-rw-r--r--test/functional/terminal/window_split_tab_spec.lua8
-rw-r--r--test/functional/ui/searchhl_spec.lua14
-rw-r--r--test/functional/ui/wildmode_spec.lua8
4 files changed, 23 insertions, 19 deletions
diff --git a/test/functional/terminal/scrollback_spec.lua b/test/functional/terminal/scrollback_spec.lua
index 75bb89a1ab..544325e746 100644
--- a/test/functional/terminal/scrollback_spec.lua
+++ b/test/functional/terminal/scrollback_spec.lua
@@ -142,15 +142,15 @@ describe(':terminal scrollback', function()
describe('and height decreased by 1', function()
if helpers.pending_win32(pending) then return end
local function will_hide_top_line()
- feed([[<C-\><C-N>:]]) -- Go to cmdline-mode, so cursor is at bottom.
+ feed([[<C-\><C-N>]])
screen:try_resize(screen._width - 2, screen._height - 1)
screen:expect([[
line2 |
line3 |
line4 |
rows: 5, cols: 28 |
- {2: } |
- :^ |
+ {2:^ } |
+ |
]])
end
@@ -166,11 +166,11 @@ describe(':terminal scrollback', function()
screen:expect([[
rows: 5, cols: 28 |
rows: 3, cols: 26 |
- {2: } |
- :^ |
+ {2:^ } |
+ |
]])
eq(8, curbuf('line_count'))
- feed([[<C-\><C-N>3k]])
+ feed([[3k]])
screen:expect([[
^line4 |
rows: 5, cols: 28 |
diff --git a/test/functional/terminal/window_split_tab_spec.lua b/test/functional/terminal/window_split_tab_spec.lua
index c0ce656bb1..ad70b3d14f 100644
--- a/test/functional/terminal/window_split_tab_spec.lua
+++ b/test/functional/terminal/window_split_tab_spec.lua
@@ -69,7 +69,7 @@ describe(':terminal', function()
end)
it('forwards resize request to the program', function()
- feed([[<C-\><C-N>G:]]) -- Go to cmdline-mode, so cursor is at bottom.
+ feed([[<C-\><C-N>G]])
local w1, h1 = screen._width - 3, screen._height - 2
local w2, h2 = w1 - 6, h1 - 3
@@ -92,16 +92,16 @@ describe(':terminal', function()
|
|
|
+ ^ |
|
- :^ |
]])
screen:try_resize(w2, h2)
screen:expect([[
tty ready |
rows: 7, cols: 47 |
rows: 4, cols: 41 |
- {2: } |
- :^ |
+ {2:^ } |
+ |
]])
end)
end)
diff --git a/test/functional/ui/searchhl_spec.lua b/test/functional/ui/searchhl_spec.lua
index a46670d8a2..65ae124353 100644
--- a/test/functional/ui/searchhl_spec.lua
+++ b/test/functional/ui/searchhl_spec.lua
@@ -163,12 +163,14 @@ describe('search highlighting', function()
]])
feed('/foo')
sleep(50) -- Allow some terminal activity.
- screen:expect([[
- {3:foo} bar baz {3:│}xxx |
- bar baz {2:foo} {3:│}xxx |
- bar {2:foo} baz {3:│}xxx |
- {3:│}xxx |
- {1:~ }{3:│}xxx |
+ -- NB: in earlier versions terminal output was redrawn during cmdline mode.
+ -- For now just assert that the screens remain unchanged.
+ screen:expect([[
+ {3:foo} bar baz {3:│} |
+ bar baz {2:foo} {3:│} |
+ bar {2:foo} baz {3:│} |
+ {3:│} |
+ {1:~ }{3:│} |
{5:[No Name] [+] }{3:term }|
/foo^ |
]], { [1] = {bold = true, foreground = Screen.colors.Blue1},
diff --git a/test/functional/ui/wildmode_spec.lua b/test/functional/ui/wildmode_spec.lua
index cf22bb0a6f..1c8854bb28 100644
--- a/test/functional/ui/wildmode_spec.lua
+++ b/test/functional/ui/wildmode_spec.lua
@@ -95,10 +95,12 @@ describe("'wildmenu'", function()
feed([[<C-\><C-N>gg]])
feed([[:sign <Tab>]]) -- Invoke wildmenu.
+ -- NB: in earlier versions terminal output was redrawn during cmdline mode.
+ -- For now just assert that the screen remains unchanged.
expect_stay_unchanged{grid=[[
- foo |
- foo |
- foo |
+ |
+ |
+ |
define jump list > |
:sign define^ |
]]}