summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-04-26 22:30:33 +0200
committerBram Moolenaar <Bram@vim.org>2018-04-26 22:30:33 +0200
commitc3c3e698966fac86dee94799b70947defb85440d (patch)
tree74b6db9a4e48e95d1f8ae0d56b8e6c599554c181 /src
parentdb0eedec16621854c772760d02427804bc0a298d (diff)
downloadvim-git-c3c3e698966fac86dee94799b70947defb85440d.tar.gz
patch 8.0.1766: expanding abbreviation doesn't workv8.0.1766
Problem: Expanding abbreviation doesn't work. (Tooth Pik) Solution: Return OK instead of FALSE and FAIL instead of TRUE. (Christian Brabandt)
Diffstat (limited to 'src')
-rw-r--r--src/edit.c4
-rw-r--r--src/testdir/test_mapping.vim16
-rw-r--r--src/version.c2
3 files changed, 20 insertions, 2 deletions
diff --git a/src/edit.c b/src/edit.c
index f29fbc79b..eaf690ce9 100644
--- 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
index 5026d6b2b..79863c4da 100644
--- 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 <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
diff --git a/src/version.c b/src/version.c
index f80e22aff..a79e38b91 100644
--- 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,