From 6449921943fa5fbcbd4e26039da1bbeaa96c6c0d Mon Sep 17 00:00:00 2001 From: Marco Hinz Date: Mon, 13 Apr 2015 02:06:31 +0200 Subject: UI test: left click in tabline --- test/functional/ui/mouse_spec.lua | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'test/functional/ui/mouse_spec.lua') diff --git a/test/functional/ui/mouse_spec.lua b/test/functional/ui/mouse_spec.lua index f1973f60ba..52078f0b7d 100644 --- a/test/functional/ui/mouse_spec.lua +++ b/test/functional/ui/mouse_spec.lua @@ -57,6 +57,33 @@ describe('Mouse input', function() ]]) end) + it('left click in tabline switches to tab', function() + local tab_attrs = { + tab = { background=Screen.colors.LightGrey, underline=true }, + sel = { bold=true }, + fill = { reverse = true } + } + execute('%delete') + insert('this is foo') + execute('silent file foo | tabnew | file bar') + insert('this is bar') + screen:expect([[ + {tab: + foo }{sel: + bar }{fill: }{tab:X}| + this is ba^r | + ~ | + ~ | + | + ]], tab_attrs) + feed('<4,0>') + screen:expect([[ + {sel: + foo }{tab: + bar }{fill: }{tab:X}| + this is fo^o | + ~ | + ~ | + | + ]], tab_attrs) + end) + it('left drag changes visual selection', function() -- drag events must be preceded by a click feed('<2,1>') -- cgit From 6fb66f44161f3e5bed519f7ac20b56f0b96bd661 Mon Sep 17 00:00:00 2001 From: Marco Hinz Date: Mon, 13 Apr 2015 03:24:50 +0200 Subject: UI test: visual selection after left click in tabline --- test/functional/ui/mouse_spec.lua | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) (limited to 'test/functional/ui/mouse_spec.lua') diff --git a/test/functional/ui/mouse_spec.lua b/test/functional/ui/mouse_spec.lua index 52078f0b7d..30f37a7463 100644 --- a/test/functional/ui/mouse_spec.lua +++ b/test/functional/ui/mouse_spec.lua @@ -61,7 +61,7 @@ describe('Mouse input', function() local tab_attrs = { tab = { background=Screen.colors.LightGrey, underline=true }, sel = { bold=true }, - fill = { reverse = true } + fill = { reverse=true } } execute('%delete') insert('this is foo') @@ -120,6 +120,43 @@ describe('Mouse input', function() ]]) end) + it('left drag changes visual selection after tab click', function() + local tab_attrs = { + tab = { background=Screen.colors.LightGrey, underline=true }, + sel = { bold=true }, + fill = { reverse=true }, + vis = { background=Screen.colors.LightGrey } + } + execute('silent file foo | tabnew | file bar') + insert('this is bar') + execute('tabprevious') -- go to first tab + screen:expect([[ + {sel: + foo }{tab: + bar }{fill: }{tab:X}| + mouse | + support and selectio^n | + ~ | + | + ]], tab_attrs) + feed('<10,0>') -- go to second tab + helpers.wait() + feed('<0,1>') + screen:expect([[ + {tab: + foo }{sel: + bar }{fill: }{tab:X}| + ^this is bar | + ~ | + ~ | + | + ]], tab_attrs) + feed('<4,1>') + screen:expect([[ + {tab: + foo }{sel: + bar }{fill: }{tab:X}| + {vis:this}^ is bar | + ~ | + ~ | + {sel:-- VISUAL --} | + ]], tab_attrs) + end) + it('two clicks will select the word and enter VISUAL', function() feed('<2,2><2,2>') screen:expect([[ -- cgit