aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-08-18 14:56:36 +0800
committerzeertzjq <zeertzjq@outlook.com>2023-08-18 19:34:07 +0800
commit5ff725fa94cc85e8dc4f92bb17e6dfd27aa0eaff (patch)
tree916003c57c28adda2c88f00a83cdb54bbb129eb6
parent81d5550d77d24a924e8c23873fccbf405bc39447 (diff)
downloadrneovim-5ff725fa94cc85e8dc4f92bb17e6dfd27aa0eaff.tar.gz
rneovim-5ff725fa94cc85e8dc4f92bb17e6dfd27aa0eaff.tar.bz2
rneovim-5ff725fa94cc85e8dc4f92bb17e6dfd27aa0eaff.zip
vim-patch:9.0.0048: cursor in wrong column with mouse click after concealed text
Problem: Cursor in wrong column with mouse click after concealed text. Solution: Store the text column when drawing text. https://github.com/vim/vim/commit/b90818867c089d4987f1a48ee3666674826d6f4b Tests only. Code changes moved to the port of patch 9.0.1725. Co-authored-by: Bram Moolenaar <Bram@vim.org>
-rw-r--r--test/old/testdir/test_conceal.vim20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/old/testdir/test_conceal.vim b/test/old/testdir/test_conceal.vim
index 63e17d8f2f..b9541b9e82 100644
--- a/test/old/testdir/test_conceal.vim
+++ b/test/old/testdir/test_conceal.vim
@@ -4,6 +4,7 @@ source check.vim
CheckFeature conceal
source screendump.vim
+source view_util.vim
func Test_conceal_two_windows()
CheckScreendump
@@ -334,4 +335,23 @@ func Test_conceal_eol()
set nolist
endfunc
+func Test_conceal_mouse_click()
+ enew!
+ set mouse=a
+ setlocal conceallevel=2 concealcursor=nc
+ syn match Concealed "this" conceal
+ hi link Concealed Search
+ call setline(1, 'conceal this click here')
+ redraw
+ call assert_equal(['conceal click here '], ScreenLines(1, 20))
+
+ " click on 'h' of "here" puts cursor there
+ call Ntest_setmouse(1, 16)
+ call feedkeys("\<LeftMouse>", "tx")
+ call assert_equal([0, 1, 20, 0, 20], getcurpos())
+
+ bwipe!
+ set mouse&
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab