changeset 11295:d772bf077b3f v8.0.0533

patch 8.0.0533: abbreviation doesn't work after backspacing newline commit https://github.com/vim/vim/commit/878c263a489b7e211eda31fa13a3d5ad9e120554 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Apr 1 15:15:52 2017 +0200 patch 8.0.0533: abbreviation doesn't work after backspacing newline Problem: Abbreviation doesn't work after backspacing newline. (Hkonrk) Solution: Set the insert start column. (closes https://github.com/vim/vim/issues/1609)
author Christian Brabandt <cb@256bit.org>
date Sat, 01 Apr 2017 15:30:04 +0200
parents 6a79bcf55287
children 4e4edcd01046
files src/edit.c src/testdir/test_mapping.vim src/version.c
diffstat 3 files changed, 15 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/edit.c
+++ b/src/edit.c
@@ -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:
--- a/src/testdir/test_mapping.vim
+++ b/src/testdir/test_mapping.vim
@@ -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
--- a/src/version.c
+++ b/src/version.c
@@ -765,6 +765,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    533,
+/**/
     532,
 /**/
     531,