Karsten Hopp 3523c3
To: vim_dev@googlegroups.com
Karsten Hopp 3523c3
Subject: Patch 7.3.111
Karsten Hopp 3523c3
Fcc: outbox
Karsten Hopp 3523c3
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 3523c3
Mime-Version: 1.0
Karsten Hopp 3523c3
Content-Type: text/plain; charset=UTF-8
Karsten Hopp 3523c3
Content-Transfer-Encoding: 8bit
Karsten Hopp 3523c3
------------
Karsten Hopp 3523c3
Karsten Hopp 3523c3
Patch 7.3.111 (after 7.3.100)
Karsten Hopp 3523c3
Problem:    Executing a :normal command in 'statusline' evaluation causes the
Karsten Hopp 3523c3
	    cursor to move. (Dominique Pelle)
Karsten Hopp 3523c3
Solution:   When updating the cursor for 'cursorbind' allow the cursor beyond
Karsten Hopp 3523c3
	    the end of the line.  When evaluating 'statusline' temporarily
Karsten Hopp 3523c3
	    reset 'cursorbind'.
Karsten Hopp 3523c3
Files:	    src/move.c, src/screen.c
Karsten Hopp 3523c3
Karsten Hopp 3523c3
Karsten Hopp 3523c3
*** ../vim-7.3.110/src/move.c	2011-01-22 21:05:02.000000000 +0100
Karsten Hopp 3523c3
--- src/move.c	2011-02-01 17:36:10.000000000 +0100
Karsten Hopp 3523c3
***************
Karsten Hopp 3523c3
*** 2846,2851 ****
Karsten Hopp 3523c3
--- 2846,2852 ----
Karsten Hopp 3523c3
      colnr_T	col =  curwin->w_cursor.col;
Karsten Hopp 3523c3
      win_T	*old_curwin = curwin;
Karsten Hopp 3523c3
      buf_T	*old_curbuf = curbuf;
Karsten Hopp 3523c3
+     int		restart_edit_save;
Karsten Hopp 3523c3
  # ifdef FEAT_VISUAL
Karsten Hopp 3523c3
      int		old_VIsual_select = VIsual_select;
Karsten Hopp 3523c3
      int		old_VIsual_active = VIsual_active;
Karsten Hopp 3523c3
***************
Karsten Hopp 3523c3
*** 2875,2882 ****
Karsten Hopp 3523c3
  		curwin->w_cursor.lnum = line;
Karsten Hopp 3523c3
  	    curwin->w_cursor.col = col;
Karsten Hopp 3523c3
  
Karsten Hopp 3523c3
! 	    /* Make sure the cursor is in a valid position. */
Karsten Hopp 3523c3
  	    check_cursor();
Karsten Hopp 3523c3
  # ifdef FEAT_MBYTE
Karsten Hopp 3523c3
  	    /* Correct cursor for multi-byte character. */
Karsten Hopp 3523c3
  	    if (has_mbyte)
Karsten Hopp 3523c3
--- 2876,2887 ----
Karsten Hopp 3523c3
  		curwin->w_cursor.lnum = line;
Karsten Hopp 3523c3
  	    curwin->w_cursor.col = col;
Karsten Hopp 3523c3
  
Karsten Hopp 3523c3
! 	    /* Make sure the cursor is in a valid position.  Temporarily set
Karsten Hopp 3523c3
! 	     * "restart_edit" to allow the cursor to be beyond the EOL. */
Karsten Hopp 3523c3
! 	    restart_edit_save = restart_edit;
Karsten Hopp 3523c3
! 	    restart_edit = TRUE;
Karsten Hopp 3523c3
  	    check_cursor();
Karsten Hopp 3523c3
+ 	    restart_edit = restart_edit_save;
Karsten Hopp 3523c3
  # ifdef FEAT_MBYTE
Karsten Hopp 3523c3
  	    /* Correct cursor for multi-byte character. */
Karsten Hopp 3523c3
  	    if (has_mbyte)
Karsten Hopp 3523c3
*** ../vim-7.3.110/src/screen.c	2010-12-30 14:57:03.000000000 +0100
Karsten Hopp 3523c3
--- src/screen.c	2011-02-01 17:45:45.000000000 +0100
Karsten Hopp 3523c3
***************
Karsten Hopp 3523c3
*** 6435,6440 ****
Karsten Hopp 3523c3
--- 6435,6442 ----
Karsten Hopp 3523c3
      struct	stl_hlrec hltab[STL_MAX_ITEM];
Karsten Hopp 3523c3
      struct	stl_hlrec tabtab[STL_MAX_ITEM];
Karsten Hopp 3523c3
      int		use_sandbox = FALSE;
Karsten Hopp 3523c3
+     win_T	*ewp;
Karsten Hopp 3523c3
+     int		p_crb_save;
Karsten Hopp 3523c3
  
Karsten Hopp 3523c3
      /* setup environment for the task at hand */
Karsten Hopp 3523c3
      if (wp == NULL)
Karsten Hopp 3523c3
***************
Karsten Hopp 3523c3
*** 6513,6526 ****
Karsten Hopp 3523c3
      if (maxwidth <= 0)
Karsten Hopp 3523c3
  	return;
Karsten Hopp 3523c3
  
Karsten Hopp 3523c3
      /* Make a copy, because the statusline may include a function call that
Karsten Hopp 3523c3
       * might change the option value and free the memory. */
Karsten Hopp 3523c3
      stl = vim_strsave(stl);
Karsten Hopp 3523c3
!     width = build_stl_str_hl(wp == NULL ? curwin : wp,
Karsten Hopp 3523c3
! 				buf, sizeof(buf),
Karsten Hopp 3523c3
  				stl, use_sandbox,
Karsten Hopp 3523c3
  				fillchar, maxwidth, hltab, tabtab);
Karsten Hopp 3523c3
      vim_free(stl);
Karsten Hopp 3523c3
  
Karsten Hopp 3523c3
      /* Make all characters printable. */
Karsten Hopp 3523c3
      p = transstr(buf);
Karsten Hopp 3523c3
--- 6515,6534 ----
Karsten Hopp 3523c3
      if (maxwidth <= 0)
Karsten Hopp 3523c3
  	return;
Karsten Hopp 3523c3
  
Karsten Hopp 3523c3
+     /* Temporarily reset 'cursorbind', we don't want a side effect from moving
Karsten Hopp 3523c3
+      * the cursor away and back. */
Karsten Hopp 3523c3
+     ewp = wp == NULL ? curwin : wp;
Karsten Hopp 3523c3
+     p_crb_save = ewp->w_p_crb;
Karsten Hopp 3523c3
+     ewp->w_p_crb = FALSE;
Karsten Hopp 3523c3
+ 
Karsten Hopp 3523c3
      /* Make a copy, because the statusline may include a function call that
Karsten Hopp 3523c3
       * might change the option value and free the memory. */
Karsten Hopp 3523c3
      stl = vim_strsave(stl);
Karsten Hopp 3523c3
!     width = build_stl_str_hl(ewp, buf, sizeof(buf),
Karsten Hopp 3523c3
  				stl, use_sandbox,
Karsten Hopp 3523c3
  				fillchar, maxwidth, hltab, tabtab);
Karsten Hopp 3523c3
      vim_free(stl);
Karsten Hopp 3523c3
+     ewp->w_p_crb = p_crb_save;
Karsten Hopp 3523c3
  
Karsten Hopp 3523c3
      /* Make all characters printable. */
Karsten Hopp 3523c3
      p = transstr(buf);
Karsten Hopp 3523c3
*** ../vim-7.3.110/src/version.c	2011-02-01 17:12:20.000000000 +0100
Karsten Hopp 3523c3
--- src/version.c	2011-02-01 18:00:14.000000000 +0100
Karsten Hopp 3523c3
***************
Karsten Hopp 3523c3
*** 716,717 ****
Karsten Hopp 3523c3
--- 716,719 ----
Karsten Hopp 3523c3
  {   /* Add new patch number below this line */
Karsten Hopp 3523c3
+ /**/
Karsten Hopp 3523c3
+     111,
Karsten Hopp 3523c3
  /**/
Karsten Hopp 3523c3
Karsten Hopp 3523c3
-- 
Karsten Hopp 3523c3
hundred-and-one symptoms of being an internet addict:
Karsten Hopp 3523c3
177. You log off of your system because it's time to go to work.
Karsten Hopp 3523c3
Karsten Hopp 3523c3
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 3523c3
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 3523c3
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp 3523c3
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///