Mercurial > vim
diff src/testdir/test_normal.vim @ 32824:22a08166a876 v9.0.1725
patch 9.0.1725: cursor pos wrong after concealed text with 'virtualedit'
Commit: https://github.com/vim/vim/commit/e500ae8e29ad921378085f5d70ee5c0c537be1ba
Author: zeertzjq <zeertzjq@outlook.com>
Date: Thu Aug 17 22:35:26 2023 +0200
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: #12808
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 17 Aug 2023 22:45:04 +0200 |
parents | 1be7af7425f6 |
children | 8665cf0eab86 |
line wrap: on
line diff
--- a/src/testdir/test_normal.vim +++ b/src/testdir/test_normal.vim @@ -4049,13 +4049,13 @@ func Test_normal_click_on_ctrl_char() call assert_equal([0, 1, 1, 0, 1], getcurpos()) call test_setmouse(1, 2) call feedkeys("\<LeftMouse>", 'xt') - call assert_equal([0, 1, 2, 0, 8], getcurpos()) + call assert_equal([0, 1, 2, 0, 2], getcurpos()) call test_setmouse(1, 3) call feedkeys("\<LeftMouse>", 'xt') - call assert_equal([0, 1, 2, 0, 8], getcurpos()) + call assert_equal([0, 1, 2, 0, 3], getcurpos()) call test_setmouse(1, 7) call feedkeys("\<LeftMouse>", 'xt') - call assert_equal([0, 1, 2, 0, 8], getcurpos()) + call assert_equal([0, 1, 2, 0, 7], getcurpos()) call test_setmouse(1, 8) call feedkeys("\<LeftMouse>", 'xt') call assert_equal([0, 1, 2, 0, 8], getcurpos()) @@ -4067,13 +4067,13 @@ func Test_normal_click_on_ctrl_char() call assert_equal([0, 1, 4, 0, 10], getcurpos()) call test_setmouse(1, 11) call feedkeys("\<LeftMouse>", 'xt') - call assert_equal([0, 1, 4, 0, 10], getcurpos()) + call assert_equal([0, 1, 4, 0, 11], getcurpos()) call test_setmouse(1, 12) call feedkeys("\<LeftMouse>", 'xt') call assert_equal([0, 1, 5, 0, 12], getcurpos()) call test_setmouse(1, 13) call feedkeys("\<LeftMouse>", 'xt') - call assert_equal([0, 1, 5, 0, v:maxcol], getcurpos()) + call assert_equal([0, 1, 5, 0, 13], getcurpos()) bwipe! let &mouse = save_mouse