aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/options_spec.lua
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2019-11-25 08:56:42 -0800
committerGitHub <noreply@github.com>2019-11-25 08:56:42 -0800
commit36d1335a667d54c26ab7cca23bc60998cb8e0fb2 (patch)
treeaf85eb985ad73cad656b3b16221fde95bcbc0f68 /test/functional/ui/options_spec.lua
parent4a77df2e518a51ffd5a5fe311424b4b5305009a7 (diff)
downloadrneovim-36d1335a667d54c26ab7cca23bc60998cb8e0fb2.tar.gz
rneovim-36d1335a667d54c26ab7cca23bc60998cb8e0fb2.tar.bz2
rneovim-36d1335a667d54c26ab7cca23bc60998cb8e0fb2.zip
UI: emit mouse_on/mouse_off on attach #11455
closes #11372
Diffstat (limited to 'test/functional/ui/options_spec.lua')
-rw-r--r--test/functional/ui/options_spec.lua29
1 files changed, 28 insertions, 1 deletions
diff --git a/test/functional/ui/options_spec.lua b/test/functional/ui/options_spec.lua
index ea71f5eae9..31007b92b1 100644
--- a/test/functional/ui/options_spec.lua
+++ b/test/functional/ui/options_spec.lua
@@ -5,7 +5,7 @@ local command = helpers.command
local eq = helpers.eq
local shallowcopy = helpers.shallowcopy
-describe('ui receives option updates', function()
+describe('UI receives option updates', function()
local screen
local function reset(opts, ...)
@@ -47,6 +47,33 @@ describe('ui receives option updates', function()
end)
end)
+ it('on attach #11372', function()
+ clear()
+ local evs = {}
+ screen = Screen.new(20,5)
+ -- Override mouse_on/mouse_off handlers.
+ function screen._handle_mouse_on()
+ table.insert(evs, 'mouse_on')
+ end
+ function screen._handle_mouse_off()
+ table.insert(evs, 'mouse_off')
+ end
+ screen:attach()
+ screen:expect(function()
+ eq({'mouse_off'}, evs)
+ end)
+ command("set mouse=nvi")
+ screen:expect(function()
+ eq({'mouse_off','mouse_on'}, evs)
+ end)
+ screen:detach()
+ eq({'mouse_off','mouse_on'}, evs)
+ screen:attach()
+ screen:expect(function()
+ eq({'mouse_off','mouse_on','mouse_on'}, evs)
+ end)
+ end)
+
it("when setting options", function()
local expected = reset()
local defaults = shallowcopy(expected)