4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=ISO-8859-1
7 Content-Transfer-Encoding: 8bit
11 Problem: When redrawing a character for bold spill this causes the next
12 character to be redrawn as well.
13 Solution: Only redraw one extra character. (Yukihiro Nakadaira)
17 *** ../vim-7.2.140/src/screen.c Wed Mar 11 17:44:38 2009
18 --- src/screen.c Wed Mar 11 13:59:24 2009
23 #if defined(FEAT_GUI) || defined(UNIX)
24 ! /* The bold trick makes a single row of pixels appear in the next
25 ! * character. When a bold character is removed, the next
26 * character should be redrawn too. This happens for our own GUI
27 * and for some xterms. */
32 #if defined(FEAT_GUI) || defined(UNIX)
33 ! /* The bold trick makes a single column of pixels appear in the
34 ! * next character. When a bold character is removed, the next
35 * character should be redrawn too. This happens for our own GUI
36 * and for some xterms. */
44 + #if defined(FEAT_MBYTE) || defined(FEAT_GUI) || defined(UNIX)
45 + int force_redraw_this;
46 + int force_redraw_next = FALSE;
50 if (ScreenLines == NULL || row >= screen_Rows) /* safety check */
52 + off = LineOffset[row] + col;
55 /* When drawing over the right halve of a double-wide char clear out the
60 && mb_fix_col(col, row) != col)
61 ! screen_puts_len((char_u *)" ", 1, row, col - 1, 0);
64 - off = LineOffset[row] + col;
66 max_off = LineOffset[row] + screen_Columns;
71 && mb_fix_col(col, row) != col)
73 ! ScreenLines[off - 1] = ' ';
74 ! ScreenAttrs[off - 1] = 0;
77 ! ScreenLinesUC[off - 1] = 0;
78 ! ScreenLinesC[0][off - 1] = 0;
80 ! /* redraw the previous cell, make it empty */
81 ! screen_char(off - 1, row, col - 1);
82 ! /* force the cell at "col" to be redrawn */
83 ! force_redraw_next = TRUE;
88 max_off = LineOffset[row] + screen_Columns;
95 ! if (ScreenLines[off] != c
98 && ScreenLines[off + 1] != (enc_dbcs ? ptr[1] : 0))
103 ! #if defined(FEAT_MBYTE) || defined(FEAT_GUI) || defined(UNIX)
104 ! force_redraw_this = force_redraw_next;
105 ! force_redraw_next = FALSE;
108 ! need_redraw = ScreenLines[off] != c
111 && ScreenLines[off + 1] != (enc_dbcs ? ptr[1] : 0))
114 || screen_comp_differs(off, u8cc)))
116 || ScreenAttrs[off] != attr
120 #if defined(FEAT_GUI) || defined(UNIX)
121 /* The bold trick makes a single row of pixels appear in the next
122 * character. When a bold character is removed, the next
123 * character should be redrawn too. This happens for our own GUI
124 ! * and for some xterms.
125 ! * Force the redraw by setting the attribute to a different value
126 ! * than "attr", the contents of ScreenLines[] may be needed by
127 ! * mb_off2cells() further on.
128 ! * Don't do this for the last drawn character, because the next
129 ! * character may not be redrawn. */
135 || screen_comp_differs(off, u8cc)))
137 || ScreenAttrs[off] != attr
141 ! #if defined(FEAT_MBYTE) || defined(FEAT_GUI) || defined(UNIX)
142 ! || force_redraw_this
146 #if defined(FEAT_GUI) || defined(UNIX)
147 /* The bold trick makes a single row of pixels appear in the next
148 * character. When a bold character is removed, the next
149 * character should be redrawn too. This happens for our own GUI
150 ! * and for some xterms. */
151 ! if (need_redraw && ScreenLines[off] != ' ' && (
164 ! n = ScreenAttrs[off];
166 ! if (col + mbyte_cells < screen_Columns
167 ! && (n > HL_ALL || (n & HL_BOLD))
168 ! && (len < 0 ? ptr[mbyte_blen] != NUL
169 ! : ptr + mbyte_blen < text + len))
170 ! ScreenAttrs[off + mbyte_cells] = attr + 1;
172 ! if (col + 1 < screen_Columns
173 ! && (n > HL_ALL || (n & HL_BOLD))
174 ! && (len < 0 ? ptr[1] != NUL : ptr + 1 < text + len))
175 ! ScreenLines[off + 1] = 0;
186 ! int n = ScreenAttrs[off];
189 ! n = syn_attr2attr(n);
191 ! force_redraw_next = TRUE;
202 + #if defined(FEAT_MBYTE) || defined(FEAT_GUI) || defined(UNIX)
203 + /* If we detected the next character needs to be redrawn, but the text
204 + * doesn't extend up to there, update the character here. */
205 + if (force_redraw_next && col < screen_Columns)
208 + if (enc_dbcs != 0 && dbcs_off2cells(off, max_off) > 1)
209 + screen_char_2(off, row, col);
212 + screen_char(off, row, col);
217 #ifdef FEAT_SEARCH_EXTRA
218 *** ../vim-7.2.140/src/version.c Wed Mar 11 17:44:38 2009
219 --- src/version.c Wed Mar 11 17:55:22 2009
223 { /* Add new patch number below this line */
229 Some of the well know MS-Windows errors:
230 ETIME Wrong time, wait a little while
232 EDETECT Unable to detect errors
233 EOVER You lost! Play another game?
234 ENOCLUE Eh, what did you want?
236 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
237 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
238 \\\ download, build and distribute -- http://www.A-A-P.org ///
239 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///