summaryrefslogtreecommitdiffstats
path: root/gvim/vim-7.2/7.2.152
blob: 107a0a4bf97c1a1b1901e9ef21da24916acde871 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
To: vim-dev@vim.org
Subject: Patch 7.2.152
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
------------

Patch 7.2.152
Problem:    When using "silent echo x" inside ":redir" a next echo may start
	    halfway the line. (Tony Mechelynck, Dennis Benzinger)
Solution:   Reset msg_col after redirecting silently.
Files:	    src/ex_docmd.c, src/message.c, src/proto/message.pro


*** ../vim-7.2.151/src/ex_docmd.c	Wed Mar 18 12:50:58 2009
--- src/ex_docmd.c	Wed Apr 22 11:57:49 2009
***************
*** 2699,2704 ****
--- 2699,2709 ----
  	/* Restore msg_scroll, it's set by file I/O commands, even when no
  	 * message is actually displayed. */
  	msg_scroll = save_msg_scroll;
+ 
+ 	/* "silent reg" or "silent echo x" inside "redir" leaves msg_col
+ 	 * somewhere in the line.  Put it back in the first column. */
+ 	if (redirecting())
+ 	    msg_col = 0;
      }
  
  #ifdef HAVE_SANDBOX
*** ../vim-7.2.151/src/message.c	Tue Feb 24 04:36:50 2009
--- src/message.c	Sun Apr 12 14:08:25 2009
***************
*** 3023,3033 ****
      if (*p_vfile != NUL)
  	verbose_write(s, maxlen);
  
!     if (redir_fd != NULL
! #ifdef FEAT_EVAL
! 			  || redir_reg || redir_vname
! #endif
! 				       )
      {
  	/* If the string doesn't start with CR or NL, go to msg_col */
  	if (*s != '\n' && *s != '\r')
--- 3023,3029 ----
      if (*p_vfile != NUL)
  	verbose_write(s, maxlen);
  
!     if (redirecting())
      {
  	/* If the string doesn't start with CR or NL, go to msg_col */
  	if (*s != '\n' && *s != '\r')
***************
*** 3074,3079 ****
--- 3070,3085 ----
      }
  }
  
+     int
+ redirecting()
+ {
+     return redir_fd != NULL
+ #ifdef FEAT_EVAL
+ 			  || redir_reg || redir_vname
+ #endif
+ 				       ;
+ }
+ 
  /*
   * Before giving verbose message.
   * Must always be called paired with verbose_leave()!
*** ../vim-7.2.151/src/proto/message.pro	Sat May  5 19:35:34 2007
--- src/proto/message.pro	Sun Apr 12 14:08:50 2009
***************
*** 54,59 ****
--- 54,60 ----
  void msg_clr_cmdline __ARGS((void));
  int msg_end __ARGS((void));
  void msg_check __ARGS((void));
+ int redirecting __ARGS((void));
  void verbose_enter __ARGS((void));
  void verbose_leave __ARGS((void));
  void verbose_enter_scroll __ARGS((void));
*** ../vim-7.2.151/src/version.c	Wed Apr 22 13:50:14 2009
--- src/version.c	Wed Apr 22 14:40:22 2009
***************
*** 678,679 ****
--- 678,681 ----
  {   /* Add new patch number below this line */
+ /**/
+     152,
  /**/

-- 
Q: How does a UNIX Guru pick up a girl?
A: look; grep; which; eval; nice; uname; talk; date;

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///