Skip to content

Commit

Permalink
patch 8.0.0533: abbreviation doesn't work after backspacing newline
Browse files Browse the repository at this point in the history
Problem:    Abbreviation doesn't work after backspacing newline. (Hkonrk)
Solution:   Set the insert start column. (closes #1609)
  • Loading branch information
brammool committed Apr 1, 2017
1 parent c77d675 commit 878c263
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/edit.c
Expand Up @@ -9017,7 +9017,7 @@ ins_bs(
#endif #endif


/* /*
* delete newline! * Delete newline!
*/ */
if (curwin->w_cursor.col == 0) if (curwin->w_cursor.col == 0)
{ {
Expand All @@ -9032,7 +9032,7 @@ ins_bs(
(linenr_T)(curwin->w_cursor.lnum + 1)) == FAIL) (linenr_T)(curwin->w_cursor.lnum + 1)) == FAIL)
return FALSE; return FALSE;
--Insstart.lnum; --Insstart.lnum;
Insstart.col = MAXCOL; Insstart.col = STRLEN(ml_get(Insstart.lnum));
} }
/* /*
* In replace mode: * In replace mode:
Expand Down
11 changes: 11 additions & 0 deletions src/testdir/test_mapping.vim
Expand Up @@ -160,3 +160,14 @@ func Test_map_meta_quotes()
set nomodified set nomodified
iunmap <M-"> iunmap <M-">
endfunc 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
2 changes: 2 additions & 0 deletions src/version.c
Expand Up @@ -764,6 +764,8 @@ static char *(features[]) =


static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
533,
/**/ /**/
532, 532,
/**/ /**/
Expand Down

0 comments on commit 878c263

Please sign in to comment.