Skip to content

Commit

Permalink
patch 8.0.1766: expanding abbreviation doesn't work
Browse files Browse the repository at this point in the history
Problem:    Expanding abbreviation doesn't work. (Tooth Pik)
Solution:   Return OK instead of FALSE and FAIL instead of TRUE. (Christian
            Brabandt)
  • Loading branch information
brammool committed Apr 26, 2018
1 parent db0eede commit c3c3e69
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/edit.c
Expand Up @@ -10209,9 +10209,9 @@ ins_eol(int c)
int i;

if (echeck_abbr(c + ABBR_OFF))
return FALSE;
return OK;
if (stop_arrow() == FAIL)
return TRUE;
return FAIL;
undisplay_dollar();

/*
Expand Down
16 changes: 16 additions & 0 deletions src/testdir/test_mapping.vim
Expand Up @@ -198,3 +198,19 @@ func Test_map_timeout()
set timeoutlen&
delfunc ExitInsert
endfunc

func Test_abbreviation_CR()
new
func Eatchar(pat)
let c = nr2char(getchar(0))
return (c =~ a:pat) ? '' : c
endfunc
iabbrev <buffer><silent> ~~7 <c-r>=repeat('~', 7)<CR><c-r>=Eatchar('\s')<cr>
call feedkeys("GA~~7 \<esc>", 'xt')
call assert_equal('~~~~~~~', getline('$'))
%d
call feedkeys("GA~~7\<cr>\<esc>", 'xt')
call assert_equal(['~~~~~~~', ''], getline(1,'$'))
delfunc Eatchar
bw!
endfunc
2 changes: 2 additions & 0 deletions src/version.c
Expand Up @@ -761,6 +761,8 @@ static char *(features[]) =

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

0 comments on commit c3c3e69

Please sign in to comment.