mirror of
https://github.com/vim/vim.git
synced 2025-10-05 05:34:07 -04:00
patch 9.1.0200: gj
/gk
not skipping over outer virtual text lines
Problem: `gj`/`gk` was updating the desired cursor virtual column to the outer virtual text, even though the actual cursor position was moved to not be on the virtual text, leading the need to do an extra `gj`/`gk` to move past each virtual text line. (rickhowe) Solution: Exclude the outer virtual text when getting the line length for moving the cursor with `gj`/`gk`, so that no extra movement is needed to skip over virtual text lines. (Dylan Thacker-Smith) fixes: #12028 related: #14262 Signed-off-by: Dylan Thacker-Smith <dylan.ah.smith@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
d3c0ff5d5a
commit
b2d124c625
@@ -2306,7 +2306,9 @@ find_decl(
|
||||
static int
|
||||
nv_screengo(oparg_T *oap, int dir, long dist)
|
||||
{
|
||||
int linelen = linetabsize(curwin, curwin->w_cursor.lnum);
|
||||
|
||||
int linelen = linetabsize_no_outer(curwin, curwin->w_cursor.lnum);
|
||||
|
||||
int retval = OK;
|
||||
int atend = FALSE;
|
||||
int n;
|
||||
@@ -2376,7 +2378,7 @@ nv_screengo(oparg_T *oap, int dir, long dist)
|
||||
}
|
||||
cursor_up_inner(curwin, 1);
|
||||
|
||||
linelen = linetabsize(curwin, curwin->w_cursor.lnum);
|
||||
linelen = linetabsize_no_outer(curwin, curwin->w_cursor.lnum);
|
||||
if (linelen > width1)
|
||||
curwin->w_curswant += (((linelen - width1 - 1) / width2)
|
||||
+ 1) * width2;
|
||||
@@ -2413,7 +2415,7 @@ nv_screengo(oparg_T *oap, int dir, long dist)
|
||||
// clipped to column 0.
|
||||
if (curwin->w_curswant >= width1)
|
||||
curwin->w_curswant -= width2;
|
||||
linelen = linetabsize(curwin, curwin->w_cursor.lnum);
|
||||
linelen = linetabsize_no_outer(curwin, curwin->w_cursor.lnum);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user