Skip to content

Commit 878c263

Browse files
committed
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)
1 parent c77d675 commit 878c263

3 files changed

Lines changed: 15 additions & 2 deletions

File tree

src/edit.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9017,7 +9017,7 @@ ins_bs(
90179017
#endif
90189018

90199019
/*
9020-
* delete newline!
9020+
* Delete newline!
90219021
*/
90229022
if (curwin->w_cursor.col == 0)
90239023
{
@@ -9032,7 +9032,7 @@ ins_bs(
90329032
(linenr_T)(curwin->w_cursor.lnum + 1)) == FAIL)
90339033
return FALSE;
90349034
--Insstart.lnum;
9035-
Insstart.col = MAXCOL;
9035+
Insstart.col = STRLEN(ml_get(Insstart.lnum));
90369036
}
90379037
/*
90389038
* In replace mode:

src/testdir/test_mapping.vim

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,3 +160,14 @@ func Test_map_meta_quotes()
160160
set nomodified
161161
iunmap <M-">
162162
endfunc
163+
164+
func Test_abbr_after_line_join()
165+
new
166+
abbr foo bar
167+
set backspace=indent,eol,start
168+
exe "normal o\<BS>foo "
169+
call assert_equal("bar ", getline(1))
170+
bwipe!
171+
unabbr foo
172+
set backspace&
173+
endfunc

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,8 @@ static char *(features[]) =
764764

765765
static int included_patches[] =
766766
{ /* Add new patch number below this line */
767+
/**/
768+
533,
767769
/**/
768770
532,
769771
/**/

0 commit comments

Comments
 (0)