aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/screen.lua
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2020-12-23 17:13:13 +0100
committerBjörn Linse <bjorn.linse@gmail.com>2021-01-01 15:47:44 +0100
commit6db86cb2d3d4ca152f156dc07362f8796150fae0 (patch)
treef87a1c0a009f4b0d054e53954db41ddeb25b991f /test/functional/ui/screen.lua
parentd0668b36a3e2d0683059baead45bea27e2358e9c (diff)
downloadrneovim-6db86cb2d3d4ca152f156dc07362f8796150fae0.tar.gz
rneovim-6db86cb2d3d4ca152f156dc07362f8796150fae0.tar.bz2
rneovim-6db86cb2d3d4ca152f156dc07362f8796150fae0.zip
ui: make 'mouse' handling in external UI more consistent
before the behaviour of 'mouse' was inconsistent in external UI, as some remapping logic would check has_mouse() and others don't (no difference in TUI or vim classic). With this change, the behaviour is consistently up to the UI decide (see ui.txt edit) Behaviour of tui.c is unaffected by this change.
Diffstat (limited to 'test/functional/ui/screen.lua')
-rw-r--r--test/functional/ui/screen.lua13
1 files changed, 8 insertions, 5 deletions
diff --git a/test/functional/ui/screen.lua b/test/functional/ui/screen.lua
index 8fa9fcc42f..fcf6926433 100644
--- a/test/functional/ui/screen.lua
+++ b/test/functional/ui/screen.lua
@@ -170,7 +170,7 @@ function Screen.new(width, height)
ruler = {},
hl_groups = {},
_default_attr_ids = nil,
- _mouse_enabled = true,
+ mouse_enabled = true,
_attrs = {},
_hl_info = {[0]={}},
_attr_table = {[0]={{},{}}},
@@ -318,7 +318,7 @@ function Screen:expect(expected, attr_ids, ...)
assert(next({...}) == nil, "invalid args to expect()")
if type(expected) == "table" then
assert(not (attr_ids ~= nil))
- local is_key = {grid=true, attr_ids=true, condition=true,
+ local is_key = {grid=true, attr_ids=true, condition=true, mouse_enabled=true,
any=true, mode=true, unchanged=true, intermediate=true,
reset=true, timeout=true, request_cb=true, hl_groups=true}
for _, v in ipairs(ext_keys) do
@@ -422,12 +422,15 @@ screen:redraw_debug() to show all intermediate screen states. ]])
if expected.mode ~= nil then
extstate.mode = self.mode
end
+ if expected.mouse_enabled ~= nil then
+ extstate.mouse_enabled = self.mouse_enabled
+ end
if expected.win_viewport == nil then
extstate.win_viewport = nil
end
-- Convert assertion errors into invalid screen state descriptions.
- for _, k in ipairs(concat_tables(ext_keys, {'mode'})) do
+ for _, k in ipairs(concat_tables(ext_keys, {'mode', 'mouse_enabled'})) do
-- Empty states are considered the default and need not be mentioned.
if (not (expected[k] == nil and isempty(extstate[k]))) then
local status, res = pcall(eq, expected[k], extstate[k], k)
@@ -799,11 +802,11 @@ function Screen:_handle_busy_stop()
end
function Screen:_handle_mouse_on()
- self._mouse_enabled = true
+ self.mouse_enabled = true
end
function Screen:_handle_mouse_off()
- self._mouse_enabled = false
+ self.mouse_enabled = false
end
function Screen:_handle_mode_change(mode, idx)