# HG changeset patch # User Christian Brabandt # Date 1524775507 -7200 # Node ID a27d380b257f1f0ef8b57def7400ebe55ffb33bb # Parent 458d0b50ba95a38bfa17ba18a04f6dbf1f3b1b0c patch 8.0.1766: expanding abbreviation doesn't work commit https://github.com/vim/vim/commit/c3c3e698966fac86dee94799b70947defb85440d Author: Bram Moolenaar Date: Thu Apr 26 22:30:33 2018 +0200 patch 8.0.1766: expanding abbreviation doesn't work Problem: Expanding abbreviation doesn't work. (Tooth Pik) Solution: Return OK instead of FALSE and FAIL instead of TRUE. (Christian Brabandt) diff --git a/src/edit.c b/src/edit.c --- a/src/edit.c +++ b/src/edit.c @@ -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(); /* diff --git a/src/testdir/test_mapping.vim b/src/testdir/test_mapping.vim --- a/src/testdir/test_mapping.vim +++ b/src/testdir/test_mapping.vim @@ -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 ~~7 =repeat('~', 7)=Eatchar('\s') + call feedkeys("GA~~7 \", 'xt') + call assert_equal('~~~~~~~', getline('$')) + %d + call feedkeys("GA~~7\\", 'xt') + call assert_equal(['~~~~~~~', ''], getline(1,'$')) + delfunc Eatchar + bw! +endfunc diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -762,6 +762,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1766, +/**/ 1765, /**/ 1764,