]> granicus.if.org Git - vim/commitdiff
patch 8.0.1201: "yL" is affected by 'scrolloff' v8.0.1201
authorBram Moolenaar <Bram@vim.org>
Sun, 15 Oct 2017 20:13:37 +0000 (22:13 +0200)
committerBram Moolenaar <Bram@vim.org>
Sun, 15 Oct 2017 20:13:37 +0000 (22:13 +0200)
Problem:    "yL" is affected by 'scrolloff'. (Eli the Bearded)
Solution:   Don't use 'scrolloff' when an operator is pending.

runtime/doc/motion.txt
src/normal.c
src/version.c

index 673d1c572a0a2de204aeef2668e49accdd12b538..85d0c4ace840c07dce9852dee32e4db366c92e78 100644 (file)
@@ -1317,7 +1317,10 @@ the current line is included.  You can then use "%" to go to the matching line.
 H                      To line [count] from top (Home) of window (default:
                        first line on the window) on the first non-blank
                        character |linewise|.  See also 'startofline' option.
-                       Cursor is adjusted for 'scrolloff' option.
+                       Cursor is adjusted for 'scrolloff' option, unless an
+                       operator is pending, in which case the text may
+                       scroll.  E.g. "yH" yanks from the first visible line
+                       until the cursor line (inclusive).
 
                                                *M*
 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
 L                      To line [count] from bottom of window (default: Last
                        line on the window) on the first non-blank character
                        |linewise|.  See also 'startofline' option.
-                       Cursor is adjusted for 'scrolloff' option.
+                       Cursor is adjusted for 'scrolloff' option, unless an
+                       operator is pending, in which case the text may
+                       scroll.  E.g. "yL" yanks from the cursor to the last
+                       visible line.
 
 <LeftMouse>            Moves to the position on the screen where the mouse
                        click is |exclusive|.  See also |<LeftMouse>|.  If the
index d78a53bae2e294d9ee781bd9a18bda3f63961e21..fbeffe51e9c4fbe44681121e5d2546441afa3537 100644 (file)
@@ -5954,7 +5954,9 @@ nv_scroll(cmdarg_T *cap)
            curwin->w_cursor.lnum = curbuf->b_ml.ml_line_count;
     }
 
-    cursor_correct();  /* correct for 'so' */
+    /* Correct for 'so', except when an operator is pending. */
+    if (cap->oap->op_type == OP_NOP)
+       cursor_correct();
     beginline(BL_SOL | BL_FIX);
 }
 
index 30a13fca266179fc38417df53e94970bcd54fb8a..edc29cc4fb4e896bdd30e6e8c01bdb7b06776122 100644 (file)
@@ -761,6 +761,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1201,
 /**/
     1200,
 /**/