On Fr, 16 Nov 2012, Christian Brabandt wrote:
> On Fri, November 16, 2012 10:10, cheater cheater wrote:
> > Hi guys,
> > I have stumbled into data loss due to this bug:
> >
> > https://groups.google.com/forum/?fromgroups=#!topic/vim_use/yRcEE2eO8TQ
> >
> > short summary: setline during insert breaks bug.
> >
> > I know putting bugs in a dusty database doesn't help them get fixed, but
> > has this bug been all-but-forgotten? I have been unable to find out
> > whether it's been fixed in the latest version.
> 
> 
> It is still in the todo list. See :h todo.txt and search for Israel

Bram,
here is a patch, that I think fixes the issue and includes a patch.

regards,
Christian

-- 
You received this message from the "vim_use" 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
diff --git a/src/edit.c b/src/edit.c
--- a/src/edit.c
+++ b/src/edit.c
@@ -8101,6 +8101,8 @@
 	if (im_on)
 	    im_set_active(TRUE);
 # endif
+	if (regname == '=')
+	    u_sync(TRUE); /* sync undo, so the effect of setline() can be undone! */
     }
     if (regname == NUL || !valid_yank_reg(regname, FALSE))
     {
diff --git a/src/testdir/test61.in b/src/testdir/test61.in
--- a/src/testdir/test61.in
+++ b/src/testdir/test61.in
@@ -84,6 +84,16 @@
 ggO---:0put b
 ggO---:0put a
 ggO---:w >>test.out
+:so small.vim
+:set nocp
+:enew!
+oa
+:set ul=100
+ob
+:set ul=100
+o1a2=setline('.','1234')
+
+uu:%w >>test.out
 :qa!
 ENDTEST
 
diff --git a/src/testdir/test61.ok b/src/testdir/test61.ok
--- a/src/testdir/test61.ok
+++ b/src/testdir/test61.ok
@@ -41,3 +41,6 @@
 two
 two
 three
+
+a
+b

Reply via email to