summaryrefslogtreecommitdiffstats
path: root/gvim/vim-7.2/7.2.141
blob: 395d210de3043982ea28b56f557f9481b59f3ed5 (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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
To: vim-dev@vim.org
Subject: Patch 7.2.141
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.141
Problem:    When redrawing a character for bold spill this causes the next
	    character to be redrawn as well.
Solution:   Only redraw one extra character. (Yukihiro Nakadaira)
Files:	    src/screen.c


*** ../vim-7.2.140/src/screen.c	Wed Mar 11 17:44:38 2009
--- src/screen.c	Wed Mar 11 13:59:24 2009
***************
*** 5132,5139 ****
  #endif
  
  #if defined(FEAT_GUI) || defined(UNIX)
! 	    /* The bold trick makes a single row of pixels appear in the next
! 	     * character.  When a bold character is removed, the next
  	     * character should be redrawn too.  This happens for our own GUI
  	     * and for some xterms. */
  	    if (
--- 5132,5139 ----
  #endif
  
  #if defined(FEAT_GUI) || defined(UNIX)
! 	    /* The bold trick makes a single column of pixels appear in the
! 	     * next character.  When a bold character is removed, the next
  	     * character should be redrawn too.  This happens for our own GUI
  	     * and for some xterms. */
  	    if (
***************
*** 6276,6284 ****
--- 6276,6290 ----
      int		pcc[MAX_MCO];
  # endif
  #endif
+ #if defined(FEAT_MBYTE) || defined(FEAT_GUI) || defined(UNIX)
+     int		force_redraw_this;
+     int		force_redraw_next = FALSE;
+ #endif
+     int		need_redraw;
  
      if (ScreenLines == NULL || row >= screen_Rows)	/* safety check */
  	return;
+     off = LineOffset[row] + col;
  
  #ifdef FEAT_MBYTE
      /* When drawing over the right halve of a double-wide char clear out the
***************
*** 6288,6297 ****
  	    && !gui.in_use
  # endif
  	    && mb_fix_col(col, row) != col)
! 	screen_puts_len((char_u *)" ", 1, row, col - 1, 0);
  #endif
  
-     off = LineOffset[row] + col;
  #ifdef FEAT_MBYTE
      max_off = LineOffset[row] + screen_Columns;
  #endif
--- 6294,6314 ----
  	    && !gui.in_use
  # endif
  	    && mb_fix_col(col, row) != col)
!     {
! 	ScreenLines[off - 1] = ' ';
! 	ScreenAttrs[off - 1] = 0;
! 	if (enc_utf8)
! 	{
! 	    ScreenLinesUC[off - 1] = 0;
! 	    ScreenLinesC[0][off - 1] = 0;
! 	}
! 	/* redraw the previous cell, make it empty */
! 	screen_char(off - 1, row, col - 1);
! 	/* force the cell at "col" to be redrawn */
! 	force_redraw_next = TRUE;
!     }
  #endif
  
  #ifdef FEAT_MBYTE
      max_off = LineOffset[row] + screen_Columns;
  #endif
***************
*** 6355,6361 ****
  	}
  #endif
  
! 	if (ScreenLines[off] != c
  #ifdef FEAT_MBYTE
  		|| (mbyte_cells == 2
  		    && ScreenLines[off + 1] != (enc_dbcs ? ptr[1] : 0))
--- 6372,6383 ----
  	}
  #endif
  
! #if defined(FEAT_MBYTE) || defined(FEAT_GUI) || defined(UNIX)
! 	force_redraw_this = force_redraw_next;
! 	force_redraw_next = FALSE;
! #endif
! 
! 	need_redraw = ScreenLines[off] != c
  #ifdef FEAT_MBYTE
  		|| (mbyte_cells == 2
  		    && ScreenLines[off + 1] != (enc_dbcs ? ptr[1] : 0))
***************
*** 6367,6386 ****
  			|| screen_comp_differs(off, u8cc)))
  #endif
  		|| ScreenAttrs[off] != attr
! 		|| exmode_active
  		)
  	{
  #if defined(FEAT_GUI) || defined(UNIX)
  	    /* The bold trick makes a single row of pixels appear in the next
  	     * character.  When a bold character is removed, the next
  	     * character should be redrawn too.  This happens for our own GUI
! 	     * and for some xterms.
! 	     * Force the redraw by setting the attribute to a different value
! 	     * than "attr", the contents of ScreenLines[] may be needed by
! 	     * mb_off2cells() further on.
! 	     * Don't do this for the last drawn character, because the next
! 	     * character may not be redrawn. */
! 	    if (
  # ifdef FEAT_GUI
  		    gui.in_use
  # endif
--- 6389,6408 ----
  			|| screen_comp_differs(off, u8cc)))
  #endif
  		|| ScreenAttrs[off] != attr
! 		|| exmode_active;
! 
! 	if (need_redraw
! #if defined(FEAT_MBYTE) || defined(FEAT_GUI) || defined(UNIX)
! 		|| force_redraw_this
! #endif
  		)
  	{
  #if defined(FEAT_GUI) || defined(UNIX)
  	    /* The bold trick makes a single row of pixels appear in the next
  	     * character.  When a bold character is removed, the next
  	     * character should be redrawn too.  This happens for our own GUI
! 	     * and for some xterms. */
! 	    if (need_redraw && ScreenLines[off] != ' ' && (
  # ifdef FEAT_GUI
  		    gui.in_use
  # endif
***************
*** 6390,6412 ****
  # ifdef UNIX
  		    term_is_xterm
  # endif
! 	       )
  	    {
! 		int		n;
  
! 		n = ScreenAttrs[off];
! # ifdef FEAT_MBYTE
! 		if (col + mbyte_cells < screen_Columns
! 			&& (n > HL_ALL || (n & HL_BOLD))
! 			&& (len < 0 ? ptr[mbyte_blen] != NUL
! 					     : ptr + mbyte_blen < text + len))
! 		    ScreenAttrs[off + mbyte_cells] = attr + 1;
! # else
! 		if (col + 1 < screen_Columns
! 			&& (n > HL_ALL || (n & HL_BOLD))
! 			&& (len < 0 ? ptr[1] != NUL : ptr + 1 < text + len))
! 		    ScreenLines[off + 1] = 0;
! # endif
  	    }
  #endif
  #ifdef FEAT_MBYTE
--- 6412,6425 ----
  # ifdef UNIX
  		    term_is_xterm
  # endif
! 		    ))
  	    {
! 		int	n = ScreenAttrs[off];
  
! 		if (n > HL_ALL)
! 		    n = syn_attr2attr(n);
! 		if (n & HL_BOLD)
! 		    force_redraw_next = TRUE;
  	    }
  #endif
  #ifdef FEAT_MBYTE
***************
*** 6493,6498 ****
--- 6506,6525 ----
  	    ++ptr;
  	}
      }
+ 
+ #if defined(FEAT_MBYTE) || defined(FEAT_GUI) || defined(UNIX)
+     /* If we detected the next character needs to be redrawn, but the text
+      * doesn't extend up to there, update the character here. */
+     if (force_redraw_next && col < screen_Columns)
+     {
+ # ifdef FEAT_MBYTE
+ 	if (enc_dbcs != 0 && dbcs_off2cells(off, max_off) > 1)
+ 	    screen_char_2(off, row, col);
+ 	else
+ # endif
+ 	    screen_char(off, row, col);
+     }
+ #endif
  }
  
  #ifdef FEAT_SEARCH_EXTRA
*** ../vim-7.2.140/src/version.c	Wed Mar 11 17:44:38 2009
--- src/version.c	Wed Mar 11 17:55:22 2009
***************
*** 678,679 ****
--- 678,681 ----
  {   /* Add new patch number below this line */
+ /**/
+     141,
  /**/

-- 
Some of the well know MS-Windows errors:
	ETIME		Wrong time, wait a little while
	ECRASH		Try again...
	EDETECT		Unable to detect errors
	EOVER		You lost!  Play another game?
	ENOCLUE		Eh, what did you want?

 /// 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    ///