]> granicus.if.org Git - vim/commitdiff
patch 8.0.0533: abbreviation doesn't work after backspacing newline v8.0.0533
authorBram Moolenaar <Bram@vim.org>
Sat, 1 Apr 2017 13:15:52 +0000 (15:15 +0200)
committerBram Moolenaar <Bram@vim.org>
Sat, 1 Apr 2017 13:15:52 +0000 (15:15 +0200)
Problem:    Abbreviation doesn't work after backspacing newline. (Hkonrk)
Solution:   Set the insert start column. (closes #1609)

src/edit.c
src/testdir/test_mapping.vim
src/version.c

index 8aa15af83d548d9b87e9d93efd471979d200f7ac..fae48c61244b713ada15496edbfeee4703de2726 100644 (file)
@@ -9017,7 +9017,7 @@ ins_bs(
 #endif
 
     /*
-     * delete newline!
+     * Delete newline!
      */
     if (curwin->w_cursor.col == 0)
     {
@@ -9032,7 +9032,7 @@ ins_bs(
                               (linenr_T)(curwin->w_cursor.lnum + 1)) == FAIL)
                return FALSE;
            --Insstart.lnum;
-           Insstart.col = MAXCOL;
+           Insstart.col = STRLEN(ml_get(Insstart.lnum));
        }
        /*
         * In replace mode:
index fa8012ad417b5e785bed655b68fd1c11786e079a..ab02a87e10cda8c143ff07619dbd61c37b178eaa 100644 (file)
@@ -160,3 +160,14 @@ func Test_map_meta_quotes()
   set nomodified
   iunmap <M-">
 endfunc
+
+func Test_abbr_after_line_join()
+  new
+  abbr foo bar
+  set backspace=indent,eol,start
+  exe "normal o\<BS>foo "
+  call assert_equal("bar ", getline(1))
+  bwipe!
+  unabbr foo
+  set backspace&
+endfunc
index 76929e7f9db1782f8bb7c516aea96ca8ed9be279..65172885530aa27eb1e779b8748646ba727cc301 100644 (file)
@@ -764,6 +764,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    533,
 /**/
     532,
 /**/