mirror of
https://github.com/neovim/neovim.git
synced 2025-10-17 15:21:47 +00:00
Merge pull request #16373 from zeertzjq/terminal-mouse-release-forward
fix(terminal): correctly forward mouse events
This commit is contained in:
@@ -66,7 +66,7 @@ describe(':terminal mouse', function()
|
||||
]])
|
||||
end)
|
||||
|
||||
it('will forward mouse clicks to the program', function()
|
||||
it('will forward mouse press, drag and release to the program', function()
|
||||
if helpers.pending_win32(pending) then return end
|
||||
feed('<LeftMouse><1,2>')
|
||||
screen:expect([[
|
||||
@@ -78,6 +78,36 @@ describe(':terminal mouse', function()
|
||||
"#{1: } |
|
||||
{3:-- TERMINAL --} |
|
||||
]])
|
||||
feed('<LeftDrag><2,2>')
|
||||
screen:expect([[
|
||||
line27 |
|
||||
line28 |
|
||||
line29 |
|
||||
line30 |
|
||||
mouse enabled |
|
||||
@##{1: } |
|
||||
{3:-- TERMINAL --} |
|
||||
]])
|
||||
feed('<LeftDrag><3,2>')
|
||||
screen:expect([[
|
||||
line27 |
|
||||
line28 |
|
||||
line29 |
|
||||
line30 |
|
||||
mouse enabled |
|
||||
@$#{1: } |
|
||||
{3:-- TERMINAL --} |
|
||||
]])
|
||||
feed('<LeftRelease><3,2>')
|
||||
screen:expect([[
|
||||
line27 |
|
||||
line28 |
|
||||
line29 |
|
||||
line30 |
|
||||
mouse enabled |
|
||||
#$#{1: } |
|
||||
{3:-- TERMINAL --} |
|
||||
]])
|
||||
end)
|
||||
|
||||
it('will forward mouse scroll to the program', function()
|
||||
@@ -94,6 +124,60 @@ describe(':terminal mouse', function()
|
||||
]])
|
||||
end)
|
||||
|
||||
it('dragging and scrolling do not interfere with each other', function()
|
||||
if helpers.pending_win32(pending) then return end
|
||||
feed('<LeftMouse><1,2>')
|
||||
screen:expect([[
|
||||
line27 |
|
||||
line28 |
|
||||
line29 |
|
||||
line30 |
|
||||
mouse enabled |
|
||||
"#{1: } |
|
||||
{3:-- TERMINAL --} |
|
||||
]])
|
||||
feed('<ScrollWheelUp><1,2>')
|
||||
screen:expect([[
|
||||
line27 |
|
||||
line28 |
|
||||
line29 |
|
||||
line30 |
|
||||
mouse enabled |
|
||||
`"#{1: } |
|
||||
{3:-- TERMINAL --} |
|
||||
]])
|
||||
feed('<LeftDrag><2,2>')
|
||||
screen:expect([[
|
||||
line27 |
|
||||
line28 |
|
||||
line29 |
|
||||
line30 |
|
||||
mouse enabled |
|
||||
@##{1: } |
|
||||
{3:-- TERMINAL --} |
|
||||
]])
|
||||
feed('<ScrollWheelUp><2,2>')
|
||||
screen:expect([[
|
||||
line27 |
|
||||
line28 |
|
||||
line29 |
|
||||
line30 |
|
||||
mouse enabled |
|
||||
`##{1: } |
|
||||
{3:-- TERMINAL --} |
|
||||
]])
|
||||
feed('<LeftRelease><2,2>')
|
||||
screen:expect([[
|
||||
line27 |
|
||||
line28 |
|
||||
line29 |
|
||||
line30 |
|
||||
mouse enabled |
|
||||
###{1: } |
|
||||
{3:-- TERMINAL --} |
|
||||
]])
|
||||
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
|
||||
nvim('command', 'set number')
|
||||
|
Reference in New Issue
Block a user