vim-patch:9.1.1836: 'culopt' "screenline" not redrawn with line("w0") and :retab

Problem:  'cursorlineopt' "screenline" isn't redrawn when moving cursor
          and then using line("w0") and :retab that does nothing.
Solution: Call redraw_for_cursorcolumn() when setting a valid w_virtcol
          (zeertzjq).

closes: vim/vim#18506

a084914361
(cherry picked from commit ba47cb7eda)
This commit is contained in:
zeertzjq
2025-10-08 06:51:15 +08:00
committed by github-actions[bot]
parent e1fe0ed2df
commit d21c23b8c9
6 changed files with 70 additions and 25 deletions

View File

@@ -394,6 +394,10 @@ func Test_conceal_mouse_click()
syn match Concealed "this" conceal
hi link Concealed Search
" Nvim: need to redraw before processing every key, because mouse clicks set
" w_redr_type, which prevent using vcols[].
lua _G.NS = vim.on_key(function() vim.cmd.redraw() end)
" Test with both 'nocursorline' and 'cursorline', as they use two different
" code paths to set virtual columns for the cells to clear.
for cul in [v:false, v:true]
@@ -550,6 +554,8 @@ func Test_conceal_mouse_click()
setlocal number& signcolumn&
endfor
lua vim.on_key(nil, _G.NS); _G.NS = nil
call CloseWindow()
set mouse&
endfunc