To: vim-dev@vim.org Subject: Patch 6.1.133 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.1.133 Problem: When drawing double-wide characters in the statusline, may clear half of a character. (Yasuhiro Matsumoto) Solution: Force redraw of the next character by setting the attributes instead of putting a NUL in ScreenLines[]. Do put a NUL in ScreenLines[] when overwriting half of a double-wide character. Files: src/screen.c *** ../vim61.132/src/screen.c Sun Jun 23 14:43:12 2002 --- src/screen.c Wed Jul 3 20:22:45 2002 *************** *** 5143,5148 **** --- 5147,5155 ---- * 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 ( *************** *** 5161,5170 **** n = ScreenAttrs[off]; # ifdef FEAT_MBYTE ! if (col + 1 + mbyte_cells - 1 < screen_Columns && (n > HL_ALL || (n & HL_BOLD)) && ptr[mbyte_blen] != NUL) ! ScreenLines[off + 1 + mbyte_cells - 1] = 0; # else if (col + 1 < screen_Columns && (n > HL_ALL || (n & HL_BOLD)) --- 5168,5177 ---- n = ScreenAttrs[off]; # ifdef FEAT_MBYTE ! if (col + mbyte_cells < screen_Columns && (n > HL_ALL || (n & HL_BOLD)) && ptr[mbyte_blen] != NUL) ! ScreenAttrs[off + mbyte_cells] = attr + 1; # else if (col + 1 < screen_Columns && (n > HL_ALL || (n & HL_BOLD)) *************** *** 5187,5192 **** --- 5194,5208 ---- && (*mb_off2cells)(off) == 1 && (*mb_off2cells)(off + 1) > 1))) clear_next_cell = TRUE; + + /* Make sure we never leave a second byte of a double-byte + * behind, it confuses mb_off2cells(). */ + if (enc_dbcs + && ((mbyte_cells == 1 && (*mb_off2cells)(off) > 1) + || (mbyte_cells == 2 + && (*mb_off2cells)(off) == 1 + && (*mb_off2cells)(off + 1) > 1))) + ScreenLines[off + mbyte_blen] = 0; #endif ScreenLines[off] = *ptr; ScreenAttrs[off] = attr; *** ../vim61.132/src/version.c Sun Jul 21 20:51:28 2002 --- src/version.c Sun Jul 21 20:53:14 2002 *************** *** 608,609 **** --- 608,611 ---- { /* Add new patch number below this line */ + /**/ + 133, /**/ -- hundred-and-one symptoms of being an internet addict: 14. You start introducing yourself as "Jim at I-I-Net dot net dot au" /// Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net \\\ /// Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim \\\ \\\ Project leader for A-A-P -- http://www.a-a-p.org /// \\\ Lord Of The Rings helps Uganda - http://iccf-holland.org/lotr.html ///