diff src/testdir/test_conceal.vim @ 29413:34e93e046526 v9.0.0048

patch 9.0.0048: cursor in wrong column with mouse click after concealed text Commit: https://github.com/vim/vim/commit/b90818867c089d4987f1a48ee3666674826d6f4b Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jul 9 04:56:24 2022 +0100 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.
author Bram Moolenaar <Bram@vim.org>
date Sat, 09 Jul 2022 06:00:06 +0200
parents 95d6e3c9aa1e
children f7a2de8a4ddc
line wrap: on
line diff
--- a/src/testdir/test_conceal.vim
+++ b/src/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
@@ -282,4 +283,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 test_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