Karsten Hopp 50665c
To: vim_dev@googlegroups.com
Karsten Hopp 50665c
Subject: Patch 7.3.1200
Karsten Hopp 50665c
Fcc: outbox
Karsten Hopp 50665c
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 50665c
Mime-Version: 1.0
Karsten Hopp 50665c
Content-Type: text/plain; charset=UTF-8
Karsten Hopp 50665c
Content-Transfer-Encoding: 8bit
Karsten Hopp 50665c
------------
Karsten Hopp 50665c
Karsten Hopp 50665c
Patch 7.3.1200
Karsten Hopp 50665c
Problem:    When calling setline() from Insert mode, using CTRL-R =, undo does
Karsten Hopp 50665c
	    not work properly. (Israel Chauca)
Karsten Hopp 50665c
Solution:   Sync undo after evaluating the expression. (Christian Brabandt)
Karsten Hopp 50665c
Files:	    src/edit.c, src/testdir/test61.in, src/testdir/test61.ok
Karsten Hopp 50665c
Karsten Hopp 50665c
Karsten Hopp 50665c
*** ../vim-7.3.1199/src/edit.c	2013-06-08 18:19:39.000000000 +0200
Karsten Hopp 50665c
--- src/edit.c	2013-06-15 17:31:18.000000000 +0200
Karsten Hopp 50665c
***************
Karsten Hopp 50665c
*** 8126,8135 ****
Karsten Hopp 50665c
      --no_mapping;
Karsten Hopp 50665c
  
Karsten Hopp 50665c
  #ifdef FEAT_EVAL
Karsten Hopp 50665c
!     /*
Karsten Hopp 50665c
!      * Don't call u_sync() while getting the expression,
Karsten Hopp 50665c
!      * evaluating it or giving an error message for it!
Karsten Hopp 50665c
!      */
Karsten Hopp 50665c
      ++no_u_sync;
Karsten Hopp 50665c
      if (regname == '=')
Karsten Hopp 50665c
      {
Karsten Hopp 50665c
--- 8126,8133 ----
Karsten Hopp 50665c
      --no_mapping;
Karsten Hopp 50665c
  
Karsten Hopp 50665c
  #ifdef FEAT_EVAL
Karsten Hopp 50665c
!     /* Don't call u_sync() while typing the expression or giving an error
Karsten Hopp 50665c
!      * message for it. Only call it explicitly. */
Karsten Hopp 50665c
      ++no_u_sync;
Karsten Hopp 50665c
      if (regname == '=')
Karsten Hopp 50665c
      {
Karsten Hopp 50665c
***************
Karsten Hopp 50665c
*** 8142,8147 ****
Karsten Hopp 50665c
--- 8140,8148 ----
Karsten Hopp 50665c
  	if (im_on)
Karsten Hopp 50665c
  	    im_set_active(TRUE);
Karsten Hopp 50665c
  # endif
Karsten Hopp 50665c
+ 	if (regname == '=')
Karsten Hopp 50665c
+ 	    /* sync undo, so the effect of e.g., setline() can be undone */
Karsten Hopp 50665c
+ 	    u_sync(TRUE);
Karsten Hopp 50665c
      }
Karsten Hopp 50665c
      if (regname == NUL || !valid_yank_reg(regname, FALSE))
Karsten Hopp 50665c
      {
Karsten Hopp 50665c
*** ../vim-7.3.1199/src/testdir/test61.in	2010-09-14 12:47:30.000000000 +0200
Karsten Hopp 50665c
--- src/testdir/test61.in	2013-06-15 17:25:53.000000000 +0200
Karsten Hopp 50665c
***************
Karsten Hopp 50665c
*** 84,89 ****
Karsten Hopp 50665c
--- 84,99 ----
Karsten Hopp 50665c
  ggO---?:0put b
Karsten Hopp 50665c
  ggO---?:0put a
Karsten Hopp 50665c
  ggO---?:w >>test.out
Karsten Hopp 50665c
+ :so small.vim
Karsten Hopp 50665c
+ :set nocp
Karsten Hopp 50665c
+ :enew!
Karsten Hopp 50665c
+ oa?
Karsten Hopp 50665c
+ :set ul=100
Karsten Hopp 50665c
+ ob?
Karsten Hopp 50665c
+ :set ul=100
Karsten Hopp 50665c
+ o1?a2?=setline('.','1234')
Karsten Hopp 50665c
+ 
Karsten Hopp 50665c
+ ?uu:%w >>test.out
Karsten Hopp 50665c
  :qa!
Karsten Hopp 50665c
  ENDTEST
Karsten Hopp 50665c
  
Karsten Hopp 50665c
*** ../vim-7.3.1199/src/testdir/test61.ok	2010-08-15 21:57:29.000000000 +0200
Karsten Hopp 50665c
--- src/testdir/test61.ok	2013-06-15 17:25:53.000000000 +0200
Karsten Hopp 50665c
***************
Karsten Hopp 50665c
*** 41,43 ****
Karsten Hopp 50665c
--- 41,46 ----
Karsten Hopp 50665c
  two
Karsten Hopp 50665c
  two
Karsten Hopp 50665c
  three
Karsten Hopp 50665c
+ 
Karsten Hopp 50665c
+ a
Karsten Hopp 50665c
+ b
Karsten Hopp 50665c
*** ../vim-7.3.1199/src/version.c	2013-06-15 17:06:31.000000000 +0200
Karsten Hopp 50665c
--- src/version.c	2013-06-15 17:39:37.000000000 +0200
Karsten Hopp 50665c
***************
Karsten Hopp 50665c
*** 730,731 ****
Karsten Hopp 50665c
--- 730,733 ----
Karsten Hopp 50665c
  {   /* Add new patch number below this line */
Karsten Hopp 50665c
+ /**/
Karsten Hopp 50665c
+     1200,
Karsten Hopp 50665c
  /**/
Karsten Hopp 50665c
Karsten Hopp 50665c
-- 
Karsten Hopp 50665c
hundred-and-one symptoms of being an internet addict:
Karsten Hopp 50665c
217. Your sex life has drastically improved...so what if it's only cyber-sex!
Karsten Hopp 50665c
Karsten Hopp 50665c
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 50665c
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 50665c
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp 50665c
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///