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 #1609)
diff --git a/src/edit.c b/src/edit.c
index 8aa15af..fae48c6 100644
--- a/src/edit.c
+++ b/src/edit.c
@@ -9017,7 +9017,7 @@
#endif
/*
- * delete newline!
+ * Delete newline!
*/
if (curwin->w_cursor.col == 0)
{
@@ -9032,7 +9032,7 @@
(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:
diff --git a/src/testdir/test_mapping.vim b/src/testdir/test_mapping.vim
index fa8012a..ab02a87 100644
--- a/src/testdir/test_mapping.vim
+++ b/src/testdir/test_mapping.vim
@@ -160,3 +160,14 @@
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
diff --git a/src/version.c b/src/version.c
index 76929e7..6517288 100644
--- a/src/version.c
+++ b/src/version.c
@@ -765,6 +765,8 @@
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 533,
+/**/
532,
/**/
531,