1
0
forked from aniani/vim

patch 9.1.0176: Cursor column wrong with 'virtualedit' and conceal

Problem:  Cursor column wrong with 'virtualedit' and conceal.
Solution: Correct cursor column at end of line if never reached.
          (zeertzjq)

closes: #14190

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
zeertzjq
2024-03-13 20:38:26 +01:00
committed by Christian Brabandt
parent 5866bc3a0f
commit 253ff4dece
13 changed files with 92 additions and 1 deletions

View File

@@ -0,0 +1,3 @@
|a+0&#ffffff0|b|c|d|e|f|g|h|i|j|k|l|m|n|p|o>p| @57
|~+0#4040ff13&| @73
| +0#0000000&@56|1|,|2|5| @9|A|l@1|

View File

@@ -0,0 +1,3 @@
|a+0&#ffffff0|b|c|d|e|f|g|h|i|j|k|l|m|n|p|o|p> @57
|~+0#4040ff13&| @73
| +0#0000000&@56|1|,|2|6| @9|A|l@1|

View File

@@ -0,0 +1,3 @@
|a+0&#ffffff0|b|c|d|e|f|g|h|i|j|k|l|m|n|p|o|p| > @56
|~+0#4040ff13&| @73
| +0#0000000&@56|1|,|2|6|-|2|7| @6|A|l@1|

View File

@@ -0,0 +1,3 @@
|a+0&#ffffff0|b|c|d|e|f|g|h|i|j|k|l|m|n|p|o|p| @1> @55
|~+0#4040ff13&| @73
| +0#0000000&@56|1|,|2|6|-|2|8| @6|A|l@1|

View File

@@ -0,0 +1,3 @@
|a+0&#ffffff0|b|c|d|e|f|g|h|i|j|k|l|m|n|p|o|p| @1>r| @54
|~+0#4040ff13&| @73
| +0#0000000&@56|1|,|2|8| @9|A|l@1|

View File

@@ -0,0 +1,3 @@
| +0&#ffffff0@57>p|o|p|n|m|l|k|j|i|h|g|f|e|d|c|b|a
| +0#4040ff13&@73|~
| +0#0000000&@56|1|,|2|5| @9|A|l@1|

View File

@@ -0,0 +1,3 @@
| +0&#ffffff0@56> |p|o|p|n|m|l|k|j|i|h|g|f|e|d|c|b|a
| +0#4040ff13&@73|~
| +0#0000000&@56|1|,|2|6| @9|A|l@1|

View File

@@ -0,0 +1,3 @@
| +0&#ffffff0@55> @1|p|o|p|n|m|l|k|j|i|h|g|f|e|d|c|b|a
| +0#4040ff13&@73|~
| +0#0000000&@56|1|,|2|6|-|2|7| @6|A|l@1|

View File

@@ -0,0 +1,3 @@
| +0&#ffffff0@54> @2|p|o|p|n|m|l|k|j|i|h|g|f|e|d|c|b|a
| +0#4040ff13&@73|~
| +0#0000000&@56|1|,|2|6|-|2|8| @6|A|l@1|

View File

@@ -0,0 +1,3 @@
| +0&#ffffff0@54>r| @1|p|o|p|n|m|l|k|j|i|h|g|f|e|d|c|b|a
| +0#4040ff13&@73|~
| +0#0000000&@56|1|,|2|8| @9|A|l@1|

View File

@@ -462,4 +462,58 @@ func Test_conceal_mouse_click()
set mouse& virtualedit&
endfunc
" Test that cursor is drawn at the correct column when it is after end of the
" line with 'virtualedit' and concealing.
func Test_conceal_virtualedit_after_eol()
CheckScreendump
let code =<< trim [CODE]
call setline(1, 'abcdefgh|hidden|ijklmnpop')
syntax match test /|hidden|/ conceal
set conceallevel=2 concealcursor=n virtualedit=all
normal! $
[CODE]
call writefile(code, 'XTest_conceal_ve_after_eol', 'D')
let buf = RunVimInTerminal('-S XTest_conceal_ve_after_eol', {'rows': 3})
call VerifyScreenDump(buf, 'Test_conceal_ve_after_eol_1', {})
call term_sendkeys(buf, "l")
call VerifyScreenDump(buf, 'Test_conceal_ve_after_eol_2', {})
call term_sendkeys(buf, "l")
call VerifyScreenDump(buf, 'Test_conceal_ve_after_eol_3', {})
call term_sendkeys(buf, "l")
call VerifyScreenDump(buf, 'Test_conceal_ve_after_eol_4', {})
call term_sendkeys(buf, "rr")
call VerifyScreenDump(buf, 'Test_conceal_ve_after_eol_5', {})
" clean up
call StopVimInTerminal(buf)
endfunc
" Same as Test_conceal_virtualedit_after_eol(), but with 'rightleft' set.
func Test_conceal_virtualedit_after_eol_rightleft()
CheckFeature rightleft
CheckScreendump
let code =<< trim [CODE]
call setline(1, 'abcdefgh|hidden|ijklmnpop')
syntax match test /|hidden|/ conceal
set conceallevel=2 concealcursor=n virtualedit=all rightleft
normal! $
[CODE]
call writefile(code, 'XTest_conceal_ve_after_eol_rl', 'D')
let buf = RunVimInTerminal('-S XTest_conceal_ve_after_eol_rl', {'rows': 3})
call VerifyScreenDump(buf, 'Test_conceal_ve_after_eol_rl_1', {})
call term_sendkeys(buf, "h")
call VerifyScreenDump(buf, 'Test_conceal_ve_after_eol_rl_2', {})
call term_sendkeys(buf, "h")
call VerifyScreenDump(buf, 'Test_conceal_ve_after_eol_rl_3', {})
call term_sendkeys(buf, "h")
call VerifyScreenDump(buf, 'Test_conceal_ve_after_eol_rl_4', {})
call term_sendkeys(buf, "rr")
call VerifyScreenDump(buf, 'Test_conceal_ve_after_eol_rl_5', {})
" clean up
call StopVimInTerminal(buf)
endfunc
" vim: shiftwidth=2 sts=2 expandtab