aboutsummaryrefslogtreecommitdiff
path: root/test/functional/terminal/mouse_spec.lua
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2023-01-25 18:31:31 +0000
committerJosh Rahm <joshuarahm@gmail.com>2023-01-25 18:31:31 +0000
commit9243becbedbb6a1592208051f8fa2b090dcc5e7d (patch)
tree607c2a862ec3f4399b8766383f6f8e04c4aa43b4 /test/functional/terminal/mouse_spec.lua
parent9e40b6e9e1bc67f2d856adb837ee64dd0e25b717 (diff)
parent3c48d3c83fc21dbc0841f9210f04bdb073d73cd1 (diff)
downloadrneovim-usermarks.tar.gz
rneovim-usermarks.tar.bz2
rneovim-usermarks.zip
Merge remote-tracking branch 'upstream/master' into usermarksusermarks
Diffstat (limited to 'test/functional/terminal/mouse_spec.lua')
-rw-r--r--test/functional/terminal/mouse_spec.lua44
1 files changed, 37 insertions, 7 deletions
diff --git a/test/functional/terminal/mouse_spec.lua b/test/functional/terminal/mouse_spec.lua
index 6e2c851df7..50c8f5e7df 100644
--- a/test/functional/terminal/mouse_spec.lua
+++ b/test/functional/terminal/mouse_spec.lua
@@ -3,6 +3,8 @@ local thelpers = require('test.functional.terminal.helpers')
local clear, eq, eval = helpers.clear, helpers.eq, helpers.eval
local feed, nvim, command = helpers.feed, helpers.nvim, helpers.command
local feed_data = thelpers.feed_data
+local is_os = helpers.is_os
+local skip = helpers.skip
describe(':terminal mouse', function()
local screen
@@ -66,7 +68,7 @@ describe(':terminal mouse', function()
end)
it('does not leave terminal mode on left-release', function()
- if helpers.pending_win32(pending) then return end
+ skip(is_os('win'))
feed('<LeftRelease>')
eq('t', eval('mode(1)'))
end)
@@ -87,7 +89,7 @@ describe(':terminal mouse', function()
end)
it('will forward mouse press, drag and release to the program', function()
- if helpers.pending_win32(pending) then return end
+ skip(is_os('win'))
feed('<LeftMouse><1,2>')
screen:expect([[
line27 |
@@ -131,7 +133,7 @@ describe(':terminal mouse', function()
end)
it('will forward mouse scroll to the program', function()
- if helpers.pending_win32(pending) then return end
+ skip(is_os('win'))
feed('<ScrollWheelUp><0,0>')
screen:expect([[
line27 |
@@ -145,7 +147,7 @@ describe(':terminal mouse', function()
end)
it('dragging and scrolling do not interfere with each other', function()
- if helpers.pending_win32(pending) then return end
+ skip(is_os('win'))
feed('<LeftMouse><1,2>')
screen:expect([[
line27 |
@@ -199,7 +201,7 @@ describe(':terminal mouse', function()
end)
it('will forward mouse clicks to the program with the correct even if set nu', function()
- if helpers.pending_win32(pending) then return end
+ skip(is_os('win'))
command('set number')
-- When the display area such as a number is clicked, it returns to the
-- normal mode.
@@ -230,7 +232,7 @@ describe(':terminal mouse', function()
end)
describe('with a split window and other buffer', function()
- if helpers.pending_win32(pending) then return end
+ skip(is_os('win'))
before_each(function()
feed('<c-\\><c-n>:vsp<cr>')
screen:expect([[
@@ -287,7 +289,7 @@ describe(':terminal mouse', function()
]])
end)
- it('wont lose focus if another window is scrolled', function()
+ it("won't lose focus if another window is scrolled", function()
feed('<ScrollWheelUp><4,0><ScrollWheelUp><4,0>')
screen:expect([[
{7: 21 }line │line30 |
@@ -310,6 +312,34 @@ describe(':terminal mouse', function()
]])
end)
+ it("scrolling another window respects 'mousescroll'", function()
+ command('set mousescroll=ver:1')
+ feed('<ScrollWheelUp><4,0>')
+ screen:expect([[
+ {7: 26 }line │line30 |
+ {7: 27 }line │rows: 5, cols: 25 |
+ {7: 28 }line │rows: 5, cols: 24 |
+ {7: 29 }line │mouse enabled |
+ {7: 30 }line │{1: } |
+ ========== ========== |
+ {3:-- TERMINAL --} |
+ ]])
+ command('set mousescroll=ver:10')
+ feed('<ScrollWheelUp><4,0>')
+ screen:expect([[
+ {7: 16 }line │line30 |
+ {7: 17 }line │rows: 5, cols: 25 |
+ {7: 18 }line │rows: 5, cols: 24 |
+ {7: 19 }line │mouse enabled |
+ {7: 20 }line │{1: } |
+ ========== ========== |
+ {3:-- TERMINAL --} |
+ ]])
+ command('set mousescroll=ver:0')
+ feed('<ScrollWheelUp><4,0>')
+ screen:expect_unchanged()
+ end)
+
it('will lose focus if another window is clicked', function()
feed('<LeftMouse><5,1>')
screen:expect([[