On Do, 26 Apr 2018, Christian Brabandt wrote:

> 
> On Mi, 25 Apr 2018, tooth pik wrote:
> 
> > not all my insertmode abbreviations are broken, many are
> > 
> > i just pulled and built 8.0.1765 -- i was at 1755 and they
> > all worked then
> > 
> > i have
> > 
> > iabbrev <silent> ~~7 <c-r>=repeat('~', 72)<CR><c-r>=Eatchar('\s')<cr>
> > 
> > (one line) in my .vimrc, and when I try to make my squiggle
> > line it inserts ~~7 in the buffer without expansion, moves
> > the cursor up a line, and gives the message:
> > 
> > Already at newest change (if i've modified the buffer) or
> > Already at oldest chante (if the insert is my first change to
> > the buffer
> > 
> > anyone have a clue what gives?
> 
> Looks like patch 8.0.1758 broke it.

I think the attached patch fixes it.

Best,
Christian
-- 
Der Newtonische Irrtum steht so nett im Konversationslexikon, 
dass man die Oktavseite nur auswendig lernen darf, um die Farbe fürs 
ganze Leben los zu sein.
                -- Goethe, Maximen und Reflektionen, Nr. 979

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.
From 09a794c8981f78b094819a2ff635d308b06be422 Mon Sep 17 00:00:00 2001
From: Christian Brabandt <[email protected]>
Date: Thu, 26 Apr 2018 11:42:53 +0200
Subject: [PATCH] Fix failure from patch 8.0.1758

---
 src/edit.c                   |  4 ++--
 src/testdir/test_mapping.vim | 16 ++++++++++++++++
 2 files changed, 18 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 58195d493..a8d18db99 100644
--- a/src/testdir/test_mapping.vim
+++ b/src/testdir/test_mapping.vim
@@ -214,3 +214,19 @@ func Test_cabbr_visual_mode()
   call assert_equal(expected, getreg(':'))
   cunabbr s
 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.16.3

Raspunde prin e-mail lui