vim-patch:9.0.1792: problem with gj/gk/gM and virtual text (#24898)

Problem:  Normal mode "gM", "gj", "gk" commands behave incorrectly with
          virtual text.
Solution: Use linetabsize() instead of linetabsize_str().

closes: vim/vim#12909

d809c0a903
This commit is contained in:
zeertzjq
2023-08-27 20:04:44 +08:00
committed by GitHub
parent 4c69279f97
commit 1f49c98036
3 changed files with 98 additions and 6 deletions

View File

@@ -115,7 +115,7 @@ static int coladvance2(pos_T *pos, bool addspaces, bool finetune, colnr_T wcol_a
col = wcol;
if ((addspaces || finetune) && !VIsual_active) {
curwin->w_curswant = linetabsize_str(line) + one_more;
curwin->w_curswant = (int)linetabsize(curwin, pos->lnum) + one_more;
if (curwin->w_curswant > 0) {
curwin->w_curswant--;
}
@@ -129,7 +129,7 @@ static int coladvance2(pos_T *pos, bool addspaces, bool finetune, colnr_T wcol_a
&& curwin->w_width_inner != 0
&& wcol >= (colnr_T)width
&& width > 0) {
csize = linetabsize_str(line);
csize = (int)linetabsize(curwin, pos->lnum);
if (csize > 0) {
csize--;
}