vim-patch:9.0.1800: Cursor position still wrong with 'showbreak' and virtual text

Problem:  Cursor position still wrong with 'showbreak' and virtual text
          after last character or 'listchars' "eol".
Solution: Remove unnecessary w_wcol adjustment in curs_columns(). Also
          fix first char of virtual text not shown at the start of a screen
          line.

closes: vim/vim#12478
closes: vim/vim#12532
closes: vim/vim#12904

6a3897232a
This commit is contained in:
zeertzjq
2023-08-28 05:51:19 +08:00
parent 128091a256
commit c70aa84b2a
3 changed files with 50 additions and 8 deletions

View File

@@ -938,7 +938,6 @@ func Test_cursor_position_with_showbreak()
vim9script
&signcolumn = 'yes'
&showbreak = '++'
&breakindent = true
&breakindentopt = 'shift:2'
var leftcol: number = win_getid()->getwininfo()->get(0, {})->get('textoff')
repeat('x', &columns - leftcol - 1)->setline(1)
@@ -952,9 +951,14 @@ func Test_cursor_position_with_showbreak()
" No line wraps, so changing 'showbreak' should lead to the same screen.
call term_sendkeys(buf, "\<C-\>\<C-O>:setlocal showbreak=+\<CR>")
call VerifyScreenDump(buf, 'Test_cursor_position_with_showbreak_1', {})
" No line wraps, so setting 'breakindent' should lead to the same screen.
call term_sendkeys(buf, "\<C-\>\<C-O>:setlocal breakindent\<CR>")
call VerifyScreenDump(buf, 'Test_cursor_position_with_showbreak_1', {})
" The first line now wraps because of "eol" in 'listchars'.
call term_sendkeys(buf, "\<C-\>\<C-O>:setlocal list\<CR>")
call VerifyScreenDump(buf, 'Test_cursor_position_with_showbreak_2', {})
call term_sendkeys(buf, "\<C-\>\<C-O>:setlocal nobreakindent\<CR>")
call VerifyScreenDump(buf, 'Test_cursor_position_with_showbreak_3', {})
call StopVimInTerminal(buf)
endfunc