Karsten Hopp 81c285
To: vim-dev@vim.org
Karsten Hopp 81c285
Subject: Patch 7.2.152
Karsten Hopp 81c285
Fcc: outbox
Karsten Hopp 81c285
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 81c285
Mime-Version: 1.0
Karsten Hopp 81c285
Content-Type: text/plain; charset=ISO-8859-1
Karsten Hopp 81c285
Content-Transfer-Encoding: 8bit
Karsten Hopp 81c285
------------
Karsten Hopp 81c285
Karsten Hopp 81c285
Patch 7.2.152
Karsten Hopp 81c285
Problem:    When using "silent echo x" inside ":redir" a next echo may start
Karsten Hopp 81c285
	    halfway the line. (Tony Mechelynck, Dennis Benzinger)
Karsten Hopp 81c285
Solution:   Reset msg_col after redirecting silently.
Karsten Hopp 81c285
Files:	    src/ex_docmd.c, src/message.c, src/proto/message.pro
Karsten Hopp 81c285
Karsten Hopp 81c285
Karsten Hopp 81c285
*** ../vim-7.2.151/src/ex_docmd.c	Wed Mar 18 12:50:58 2009
Karsten Hopp 81c285
--- src/ex_docmd.c	Wed Apr 22 11:57:49 2009
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 2699,2704 ****
Karsten Hopp 81c285
--- 2699,2709 ----
Karsten Hopp 81c285
  	/* Restore msg_scroll, it's set by file I/O commands, even when no
Karsten Hopp 81c285
  	 * message is actually displayed. */
Karsten Hopp 81c285
  	msg_scroll = save_msg_scroll;
Karsten Hopp 81c285
+ 
Karsten Hopp 81c285
+ 	/* "silent reg" or "silent echo x" inside "redir" leaves msg_col
Karsten Hopp 81c285
+ 	 * somewhere in the line.  Put it back in the first column. */
Karsten Hopp 81c285
+ 	if (redirecting())
Karsten Hopp 81c285
+ 	    msg_col = 0;
Karsten Hopp 81c285
      }
Karsten Hopp 81c285
  
Karsten Hopp 81c285
  #ifdef HAVE_SANDBOX
Karsten Hopp 81c285
*** ../vim-7.2.151/src/message.c	Tue Feb 24 04:36:50 2009
Karsten Hopp 81c285
--- src/message.c	Sun Apr 12 14:08:25 2009
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 3023,3033 ****
Karsten Hopp 81c285
      if (*p_vfile != NUL)
Karsten Hopp 81c285
  	verbose_write(s, maxlen);
Karsten Hopp 81c285
  
Karsten Hopp 81c285
!     if (redir_fd != NULL
Karsten Hopp 81c285
! #ifdef FEAT_EVAL
Karsten Hopp 81c285
! 			  || redir_reg || redir_vname
Karsten Hopp 81c285
! #endif
Karsten Hopp 81c285
! 				       )
Karsten Hopp 81c285
      {
Karsten Hopp 81c285
  	/* If the string doesn't start with CR or NL, go to msg_col */
Karsten Hopp 81c285
  	if (*s != '\n' && *s != '\r')
Karsten Hopp 81c285
--- 3023,3029 ----
Karsten Hopp 81c285
      if (*p_vfile != NUL)
Karsten Hopp 81c285
  	verbose_write(s, maxlen);
Karsten Hopp 81c285
  
Karsten Hopp 81c285
!     if (redirecting())
Karsten Hopp 81c285
      {
Karsten Hopp 81c285
  	/* If the string doesn't start with CR or NL, go to msg_col */
Karsten Hopp 81c285
  	if (*s != '\n' && *s != '\r')
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 3074,3079 ****
Karsten Hopp 81c285
--- 3070,3085 ----
Karsten Hopp 81c285
      }
Karsten Hopp 81c285
  }
Karsten Hopp 81c285
  
Karsten Hopp 81c285
+     int
Karsten Hopp 81c285
+ redirecting()
Karsten Hopp 81c285
+ {
Karsten Hopp 81c285
+     return redir_fd != NULL
Karsten Hopp 81c285
+ #ifdef FEAT_EVAL
Karsten Hopp 81c285
+ 			  || redir_reg || redir_vname
Karsten Hopp 81c285
+ #endif
Karsten Hopp 81c285
+ 				       ;
Karsten Hopp 81c285
+ }
Karsten Hopp 81c285
+ 
Karsten Hopp 81c285
  /*
Karsten Hopp 81c285
   * Before giving verbose message.
Karsten Hopp 81c285
   * Must always be called paired with verbose_leave()!
Karsten Hopp 81c285
*** ../vim-7.2.151/src/proto/message.pro	Sat May  5 19:35:34 2007
Karsten Hopp 81c285
--- src/proto/message.pro	Sun Apr 12 14:08:50 2009
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 54,59 ****
Karsten Hopp 81c285
--- 54,60 ----
Karsten Hopp 81c285
  void msg_clr_cmdline __ARGS((void));
Karsten Hopp 81c285
  int msg_end __ARGS((void));
Karsten Hopp 81c285
  void msg_check __ARGS((void));
Karsten Hopp 81c285
+ int redirecting __ARGS((void));
Karsten Hopp 81c285
  void verbose_enter __ARGS((void));
Karsten Hopp 81c285
  void verbose_leave __ARGS((void));
Karsten Hopp 81c285
  void verbose_enter_scroll __ARGS((void));
Karsten Hopp 81c285
*** ../vim-7.2.151/src/version.c	Wed Apr 22 13:50:14 2009
Karsten Hopp 81c285
--- src/version.c	Wed Apr 22 14:40:22 2009
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 678,679 ****
Karsten Hopp 81c285
--- 678,681 ----
Karsten Hopp 81c285
  {   /* Add new patch number below this line */
Karsten Hopp 81c285
+ /**/
Karsten Hopp 81c285
+     152,
Karsten Hopp 81c285
  /**/
Karsten Hopp 81c285
Karsten Hopp 81c285
-- 
Karsten Hopp 81c285
Q: How does a UNIX Guru pick up a girl?
Karsten Hopp 81c285
A: look; grep; which; eval; nice; uname; talk; date;
Karsten Hopp 81c285
Karsten Hopp 81c285
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 81c285
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 81c285
\\\        download, build and distribute -- http://www.A-A-P.org        ///
Karsten Hopp 81c285
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///