Skip to content

Commit 44cc4cf

Browse files
committed
patch 8.0.1201: "yL" is affected by 'scrolloff'
Problem: "yL" is affected by 'scrolloff'. (Eli the Bearded) Solution: Don't use 'scrolloff' when an operator is pending.
1 parent 67418d9 commit 44cc4cf

3 files changed

Lines changed: 13 additions & 3 deletions

File tree

runtime/doc/motion.txt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1317,7 +1317,10 @@ the current line is included. You can then use "%" to go to the matching line.
13171317
H To line [count] from top (Home) of window (default:
13181318
first line on the window) on the first non-blank
13191319
character |linewise|. See also 'startofline' option.
1320-
Cursor is adjusted for 'scrolloff' option.
1320+
Cursor is adjusted for 'scrolloff' option, unless an
1321+
operator is pending, in which case the text may
1322+
scroll. E.g. "yH" yanks from the first visible line
1323+
until the cursor line (inclusive).
13211324

13221325
*M*
13231326
M To Middle line of window, on the first non-blank
@@ -1327,7 +1330,10 @@ M To Middle line of window, on the first non-blank
13271330
L To line [count] from bottom of window (default: Last
13281331
line on the window) on the first non-blank character
13291332
|linewise|. See also 'startofline' option.
1330-
Cursor is adjusted for 'scrolloff' option.
1333+
Cursor is adjusted for 'scrolloff' option, unless an
1334+
operator is pending, in which case the text may
1335+
scroll. E.g. "yL" yanks from the cursor to the last
1336+
visible line.
13311337

13321338
<LeftMouse> Moves to the position on the screen where the mouse
13331339
click is |exclusive|. See also |<LeftMouse>|. If the

src/normal.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5954,7 +5954,9 @@ nv_scroll(cmdarg_T *cap)
59545954
curwin->w_cursor.lnum = curbuf->b_ml.ml_line_count;
59555955
}
59565956

5957-
cursor_correct(); /* correct for 'so' */
5957+
/* Correct for 'so', except when an operator is pending. */
5958+
if (cap->oap->op_type == OP_NOP)
5959+
cursor_correct();
59585960
beginline(BL_SOL | BL_FIX);
59595961
}
59605962

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -761,6 +761,8 @@ static char *(features[]) =
761761

762762
static int included_patches[] =
763763
{ /* Add new patch number below this line */
764+
/**/
765+
1201,
764766
/**/
765767
1200,
766768
/**/

0 commit comments

Comments
 (0)