To: vim-dev@vim.org Subject: Patch 7.0.122 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 7.0.122 Problem: GUI: When clearing after a bold, double-wide character half a character may be drawn. Solution: Check for double-wide character and redraw it. (Yukihiro Nakadaira) Files: src/screen.c *** ../vim-7.0.121/src/screen.c Thu Sep 14 21:04:09 2006 --- src/screen.c Sat Oct 7 15:13:43 2006 *************** *** 5079,5093 **** * character too. If we didn't skip any blanks above, then we * only redraw if the character wasn't already redrawn anyway. */ ! if (gui.in_use && (col > startCol || !redraw_this) ! # ifdef FEAT_MBYTE ! && enc_dbcs == 0 ! # endif ! ) { hl = ScreenAttrs[off_to]; if (hl > HL_ALL || (hl & HL_BOLD)) ! screen_char(off_to - 1, row, col + coloff - 1); } #endif screen_fill(row, row + 1, col + coloff, clear_width + coloff, --- 5079,5116 ---- * character too. If we didn't skip any blanks above, then we * only redraw if the character wasn't already redrawn anyway. */ ! if (gui.in_use && (col > startCol || !redraw_this)) { hl = ScreenAttrs[off_to]; if (hl > HL_ALL || (hl & HL_BOLD)) ! { ! int prev_cells = 1; ! # ifdef FEAT_MBYTE ! if (enc_utf8) ! /* for utf-8, ScreenLines[char_offset + 1] == 0 means ! * that its width is 2. */ ! prev_cells = ScreenLines[off_to - 1] == 0 ? 2 : 1; ! else if (enc_dbcs != 0) ! { ! /* find previous character by counting from first ! * column and get its width. */ ! unsigned off = LineOffset[row]; ! ! while (off < off_to) ! { ! prev_cells = (*mb_off2cells)(off); ! off += prev_cells; ! } ! } ! ! if (enc_dbcs != 0 && prev_cells > 1) ! screen_char_2(off_to - prev_cells, row, ! col + coloff - prev_cells); ! else ! # endif ! screen_char(off_to - prev_cells, row, ! col + coloff - prev_cells); ! } } #endif screen_fill(row, row + 1, col + coloff, clear_width + coloff, *** ../vim-7.0.121/src/version.c Sun Oct 8 13:56:53 2006 --- src/version.c Mon Oct 9 22:10:17 2006 *************** *** 668,669 **** --- 668,671 ---- { /* Add new patch number below this line */ + /**/ + 122, /**/ -- How To Keep A Healthy Level Of Insanity: 7. Finish all your sentences with "in accordance with the prophecy". /// 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 ///