aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/screen.lua
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2018-09-29 13:28:53 +0200
committerBjörn Linse <bjorn.linse@gmail.com>2018-10-02 10:52:37 +0200
commitbab3b0ad45d0512ad4e5d42a44807bb39492435f (patch)
tree235a4101886a60fc401420de39fd0072798858ed /test/functional/ui/screen.lua
parent43823acae279a09e4fb51407da86340a10714d38 (diff)
downloadrneovim-bab3b0ad45d0512ad4e5d42a44807bb39492435f.tar.gz
rneovim-bab3b0ad45d0512ad4e5d42a44807bb39492435f.tar.bz2
rneovim-bab3b0ad45d0512ad4e5d42a44807bb39492435f.zip
ui: reserve the right to split a screen redraw into multiple batches.
Diffstat (limited to 'test/functional/ui/screen.lua')
-rw-r--r--test/functional/ui/screen.lua21
1 files changed, 18 insertions, 3 deletions
diff --git a/test/functional/ui/screen.lua b/test/functional/ui/screen.lua
index 0b265d6867..691bf9f64c 100644
--- a/test/functional/ui/screen.lua
+++ b/test/functional/ui/screen.lua
@@ -386,9 +386,13 @@ function Screen:wait(check, timeout)
local err, checked = false
local success_seen = false
local failure_after_success = false
+ local did_flush = true
local function notification_cb(method, args)
assert(method == 'redraw')
- self:_redraw(args)
+ did_flush = self:_redraw(args)
+ if not did_flush then
+ return
+ end
err = check()
checked = true
if not err then
@@ -402,7 +406,9 @@ function Screen:wait(check, timeout)
return true
end
run(nil, notification_cb, nil, timeout or self.timeout)
- if not checked then
+ if not did_flush then
+ err = "no flush received"
+ elseif not checked then
err = check()
end
@@ -431,7 +437,8 @@ function Screen:sleep(ms)
end
function Screen:_redraw(updates)
- for _, update in ipairs(updates) do
+ local did_flush = false
+ for k, update in ipairs(updates) do
-- print('--')
-- print(require('inspect')(update))
local method = update[1]
@@ -446,7 +453,11 @@ function Screen:_redraw(updates)
self._on_event(method, update[i])
end
end
+ if k == #updates and method == "flush" then
+ did_flush = true
+ end
end
+ return did_flush
end
function Screen:set_on_event_handler(callback)
@@ -472,6 +483,10 @@ function Screen:_handle_resize(width, height)
}
end
+function Screen:_handle_flush()
+end
+
+
function Screen:_handle_grid_resize(grid, width, height)
assert(grid == 1)
self:_handle_resize(width, height)