diff options
author | Ville Hakulinen <ville.hakulinen@gmail.com> | 2021-09-10 17:24:41 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-10 07:24:41 -0700 |
commit | 0dcfd0e8d101389fb6a33a7e887114ea0c062648 (patch) | |
tree | 23f79e65a0ba842d86c01dbb5b9ed2bd46829aee /test/functional/ui/multigrid_spec.lua | |
parent | c58ee4ef7f7aa6623be71368df9a19b0f7f93251 (diff) | |
download | rneovim-0dcfd0e8d101389fb6a33a7e887114ea0c062648.tar.gz rneovim-0dcfd0e8d101389fb6a33a7e887114ea0c062648.tar.bz2 rneovim-0dcfd0e8d101389fb6a33a7e887114ea0c062648.zip |
fix(mouse.c): fix mouse drag positions on multigrid #12667
Currently, multigrid mouse drag positions are handled incorrectly if the
drag event is not in the top left grid. Fix this by not adjusting the
position of the event in jump_to_mouse.
related: #15091
Diffstat (limited to 'test/functional/ui/multigrid_spec.lua')
-rw-r--r-- | test/functional/ui/multigrid_spec.lua | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/test/functional/ui/multigrid_spec.lua b/test/functional/ui/multigrid_spec.lua index 03cb43a7d1..fdf8e66e4f 100644 --- a/test/functional/ui/multigrid_spec.lua +++ b/test/functional/ui/multigrid_spec.lua @@ -34,6 +34,7 @@ describe('ext_multigrid', function() [17] = {background = Screen.colors.LightGrey, underline = true, bold = true, foreground = Screen.colors.Magenta}, [18] = {bold = true, foreground = Screen.colors.Magenta}, [19] = {foreground = Screen.colors.Brown}, + [20] = {background = Screen.colors.LightGrey}, }) end) @@ -2034,6 +2035,66 @@ describe('ext_multigrid', function() ]]} end) + it('supports mouse drag with mouse=a', function() + command('set mouse=a') + command('vsplit') + command('wincmd l') + command('split') + command('enew') + feed('ifoo\nbar<esc>') + + meths.input_mouse('left', 'press', '', 5, 0, 0) + poke_eventloop() + meths.input_mouse('left', 'drag', '', 5, 1, 2) + + screen:expect{grid=[[ + ## grid 1 + [4:--------------------------]{12:│}[5:--------------------------]| + [4:--------------------------]{12:│}[5:--------------------------]| + [4:--------------------------]{12:│}[5:--------------------------]| + [4:--------------------------]{12:│}[5:--------------------------]| + [4:--------------------------]{12:│}[5:--------------------------]| + [4:--------------------------]{12:│}[5:--------------------------]| + [4:--------------------------]{12:│}{11:[No Name] [+] }| + [4:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| + [4:--------------------------]{12:│}[2:--------------------------]| + {12:[No Name] [No Name] }| + [3:-----------------------------------------------------]| + ## grid 2 + | + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + ## grid 3 + {7:-- VISUAL --} | + ## grid 4 + | + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + ## grid 5 + {20:foo} | + {20:ba}^r | + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + ]]} + + end) + it('has viewport information', function() screen:try_resize(48, 8) screen:expect{grid=[[ |