diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-08-18 15:00:03 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2023-08-18 19:34:16 +0800 |
commit | 551998b7eed7dd411e4d14f65b108ae8a93c4081 (patch) | |
tree | 3121aa578a285678a58e2dbd1ed578750a284d95 /test/functional/ui/mouse_spec.lua | |
parent | b0dda500e9b45e39e872d76e8b753933c5467f83 (diff) | |
download | rneovim-551998b7eed7dd411e4d14f65b108ae8a93c4081.tar.gz rneovim-551998b7eed7dd411e4d14f65b108ae8a93c4081.tar.bz2 rneovim-551998b7eed7dd411e4d14f65b108ae8a93c4081.zip |
vim-patch:9.0.1725: cursor pos wrong after concealed text with 'virtualedit'
Problem: Wrong cursor position when clicking after concealed text
with 'virtualedit'.
Solution: Store virtual columns in ScreenCols[] instead of text
columns, and always use coladvance() when clicking.
This also fixes incorrect curswant when clicking on a TAB, so now
Test_normal_click_on_ctrl_char() asserts the same results as the ones
before patch 9.0.0048.
closes: vim/vim#12808
https://github.com/vim/vim/commit/e500ae8e29ad921378085f5d70ee5c0c537be1ba
Remove the mouse_adjust_click() function.
There is a difference in behavior with the old mouse_adjust_click()
approach: when clicking on the character immediately after concealed
text that is completely hidden, cursor is put on the clicked character
rather than at the start of the concealed text. The new behavior is
better, but it causes unnecessary scrolling in a functional test (which
is an existing issue unrelated to these patches), so adjust the test.
Now fully merged:
vim-patch:9.0.0177: cursor position wrong with 'virtualedit' and mouse click
Diffstat (limited to 'test/functional/ui/mouse_spec.lua')
-rw-r--r-- | test/functional/ui/mouse_spec.lua | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/test/functional/ui/mouse_spec.lua b/test/functional/ui/mouse_spec.lua index d126e27cde..657cc0c325 100644 --- a/test/functional/ui/mouse_spec.lua +++ b/test/functional/ui/mouse_spec.lua @@ -1089,7 +1089,6 @@ describe('ui/mouse/input', function() command([[setlocal concealcursor=ni nowrap shiftwidth=2 tabstop=4 list listchars=tab:>-]]) command([[syntax region X0 matchgroup=X1 start=/\*/ end=/\*/ concealends contains=X2]]) command([[syntax match X2 /cats/ conceal cchar=X contained]]) - -- No heap-use-after-free with multi-line syntax pattern #24317 command([[syntax match X3 /\n\@<=x/ conceal cchar=>]]) command([[highlight link X0 Normal]]) command([[highlight link X1 NonText]]) @@ -1497,7 +1496,6 @@ describe('ui/mouse/input', function() ]]) end) -- level 2 - wrapped - it('(level 3) click on non-wrapped lines', function() feed_command('let &conceallevel=3', 'echo') @@ -1535,6 +1533,7 @@ describe('ui/mouse/input', function() ]]) feed('<esc><LeftMouse><20,2>') + feed('zH') -- FIXME: unnecessary horizontal scrolling screen:expect([[ Section{0:>>--->--->---}t1 | {0:>--->--->---} t2 t3 t4 | |