]> granicus.if.org Git - vim/commitdiff
patch 8.2.5162: reading before the start of the line with BS in Replace mode v8.2.5162
authorBram Moolenaar <Bram@vim.org>
Sun, 26 Jun 2022 11:59:02 +0000 (12:59 +0100)
committerBram Moolenaar <Bram@vim.org>
Sun, 26 Jun 2022 11:59:02 +0000 (12:59 +0100)
Problem:    Reading before the start of the line with BS in Replace mode.
Solution:   Check the cursor column is more than zero.

src/edit.c
src/version.c

index dbfa0ae5f9929dfae8b8f7f4a529e02a713cb639..a8e695c91c49e649bafe193f706f3cd7954dac35 100644 (file)
@@ -4183,7 +4183,7 @@ ins_bs(
 #endif
 
            // delete characters until we are at or before want_vcol
-           while (vcol > want_vcol
+           while (vcol > want_vcol && curwin->w_cursor.col > 0
                    && (cc = *(ml_get_cursor() - 1), VIM_ISWHITE(cc)))
                ins_bs_one(&vcol);
 
index 9fba35bea067630c7d4e385669c81f49158aa4a5..cf2e77d9fb7915516ce64070ff232e2a07b7a223 100644 (file)
@@ -735,6 +735,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    5162,
 /**/
     5161,
 /**/