aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/mouse_spec.lua
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2021-10-04 23:08:39 +0200
committerGitHub <noreply@github.com>2021-10-04 23:08:39 +0200
commitb60e6448ebf8107b4e2151e69a826149ccd13c77 (patch)
tree04563c954d7fb7e9edf1bb6e29b85274773d32cc /test/functional/ui/mouse_spec.lua
parent83fa8956c3ababef977b15fc9ce935fee1445e9c (diff)
parent810da1a7023ec87e3fa644499a655740c01baaf7 (diff)
downloadrneovim-b60e6448ebf8107b4e2151e69a826149ccd13c77.tar.gz
rneovim-b60e6448ebf8107b4e2151e69a826149ccd13c77.tar.bz2
rneovim-b60e6448ebf8107b4e2151e69a826149ccd13c77.zip
Merge pull request #15813 from bfredl/neomouse
fix(mouse): correct dragged position in composed layout
Diffstat (limited to 'test/functional/ui/mouse_spec.lua')
-rw-r--r--test/functional/ui/mouse_spec.lua63
1 files changed, 63 insertions, 0 deletions
diff --git a/test/functional/ui/mouse_spec.lua b/test/functional/ui/mouse_spec.lua
index d3fe38ef52..baacef358f 100644
--- a/test/functional/ui/mouse_spec.lua
+++ b/test/functional/ui/mouse_spec.lua
@@ -585,6 +585,69 @@ describe('ui/mouse/input', function()
]])
end)
+ it('left drag changes visual selection in split layout', function()
+ screen:try_resize(53,14)
+ command('set mouse=a')
+ command('vsplit')
+ command('wincmd l')
+ command('below split')
+ command('enew')
+ feed('ifoo\nbar<esc>')
+
+ screen:expect{grid=[[
+ testing {4:│}testing |
+ mouse {4:│}mouse |
+ support and selection {4:│}support and selection |
+ {0:~ }{4:│}{0:~ }|
+ {0:~ }{4:│}{0:~ }|
+ {0:~ }{4:│[No Name] [+] }|
+ {0:~ }{4:│}foo{0:$} |
+ {0:~ }{4:│}ba^r{0:$} |
+ {0:~ }{4:│}{0:~ }|
+ {0:~ }{4:│}{0:~ }|
+ {0:~ }{4:│}{0:~ }|
+ {0:~ }{4:│}{0:~ }|
+ {4:[No Name] [+] }{5:[No Name] [+] }|
+ |
+ ]]}
+
+ meths.input_mouse('left', 'press', '', 0, 6, 27)
+ screen:expect{grid=[[
+ testing {4:│}testing |
+ mouse {4:│}mouse |
+ support and selection {4:│}support and selection |
+ {0:~ }{4:│}{0:~ }|
+ {0:~ }{4:│}{0:~ }|
+ {0:~ }{4:│[No Name] [+] }|
+ {0:~ }{4:│}^foo{0:$} |
+ {0:~ }{4:│}bar{0:$} |
+ {0:~ }{4:│}{0:~ }|
+ {0:~ }{4:│}{0:~ }|
+ {0:~ }{4:│}{0:~ }|
+ {0:~ }{4:│}{0:~ }|
+ {4:[No Name] [+] }{5:[No Name] [+] }|
+ |
+ ]]}
+ meths.input_mouse('left', 'drag', '', 0, 7, 30)
+
+ screen:expect{grid=[[
+ testing {4:│}testing |
+ mouse {4:│}mouse |
+ support and selection {4:│}support and selection |
+ {0:~ }{4:│}{0:~ }|
+ {0:~ }{4:│}{0:~ }|
+ {0:~ }{4:│[No Name] [+] }|
+ {0:~ }{4:│}{1:foo}{3:$} |
+ {0:~ }{4:│}{1:bar}{0:^$} |
+ {0:~ }{4:│}{0:~ }|
+ {0:~ }{4:│}{0:~ }|
+ {0:~ }{4:│}{0:~ }|
+ {0:~ }{4:│}{0:~ }|
+ {4:[No Name] [+] }{5:[No Name] [+] }|
+ {2:-- VISUAL --} |
+ ]]}
+ end)
+
it('two clicks will select the word and enter VISUAL', function()
feed('<LeftMouse><2,2><LeftMouse><2,2>')
screen:expect([[