aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/screen.lua
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2019-12-01 01:06:10 -0800
committerGitHub <noreply@github.com>2019-12-01 01:06:10 -0800
commita17ccb0d24eff5e6ce0e08f8ce9c4273cd9803b4 (patch)
treeaccebdef9cc7c8f1ead0508edbb2f0592f4ba145 /test/functional/ui/screen.lua
parentbff42cd7b33a764c2c54204106523137b1cf00e8 (diff)
downloadrneovim-a17ccb0d24eff5e6ce0e08f8ce9c4273cd9803b4.tar.gz
rneovim-a17ccb0d24eff5e6ce0e08f8ce9c4273cd9803b4.tar.bz2
rneovim-a17ccb0d24eff5e6ce0e08f8ce9c4273cd9803b4.zip
screen.lua: remove screen:_on_event #11488
Tests can redefine the handlers, so we don't need this extra hook.
Diffstat (limited to 'test/functional/ui/screen.lua')
-rw-r--r--test/functional/ui/screen.lua21
1 files changed, 6 insertions, 15 deletions
diff --git a/test/functional/ui/screen.lua b/test/functional/ui/screen.lua
index d3f78bf77b..64f784afe3 100644
--- a/test/functional/ui/screen.lua
+++ b/test/functional/ui/screen.lua
@@ -606,17 +606,12 @@ function Screen:_redraw(updates)
for i = 2, #update do
local handler_name = '_handle_'..method
local handler = self[handler_name]
- if handler ~= nil then
- local status, res = pcall(handler, self, unpack(update[i]))
- if not status then
- error(handler_name..' failed'
- ..'\n payload: '..inspect(update)
- ..'\n error: '..tostring(res))
- end
- else
- assert(self._on_event,
- "Add Screen:"..handler_name.." or call Screen:set_on_event_handler")
- self._on_event(method, update[i])
+ assert(handler ~= nil, "missing handler: Screen:"..handler_name)
+ local status, res = pcall(handler, self, unpack(update[i]))
+ if not status then
+ error(handler_name..' failed'
+ ..'\n payload: '..inspect(update)
+ ..'\n error: '..tostring(res))
end
end
if k == #updates and method == "flush" then
@@ -626,10 +621,6 @@ function Screen:_redraw(updates)
return did_flush
end
-function Screen:set_on_event_handler(callback)
- self._on_event = callback
-end
-
function Screen:_handle_resize(width, height)
self:_handle_grid_resize(1, width, height)
self._scroll_region = {