To: vim-dev@vim.org Subject: Patch 6.1.096 Fcc: outbox From: Bram Moolenaar MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.1.096 Problem: When erasing the right halve of a double-byte character, it may cause further characters to be erased. (Yasuhiro Matsumoto) Solution: Make sure only one character is erased. Files: src/screen.c *** ../vim61.095/src/screen.c Sat May 11 20:59:21 2002 --- src/screen.c Sun Jun 9 16:45:36 2002 *************** *** 5176,5183 **** /* When at the end of the text and overwriting a two-cell * character with a one-cell character, need to clear the next * cell. Also when overwriting the left halve of a two-cell ! * char with the right halve of a two-cell char. */ ! if (has_mbyte && ptr[mbyte_blen] == NUL && ((mbyte_cells == 1 && (*mb_off2cells)(off) > 1) || (mbyte_cells == 2 && (*mb_off2cells)(off) == 1 --- 5181,5191 ---- /* When at the end of the text and overwriting a two-cell * character with a one-cell character, need to clear the next * cell. Also when overwriting the left halve of a two-cell ! * char with the right halve of a two-cell char. Do this only ! * once (mb_off2cells() may return 2 on the right halve). */ ! if (clear_next_cell) ! clear_next_cell = FALSE; ! else if (has_mbyte && ptr[mbyte_blen] == NUL && ((mbyte_cells == 1 && (*mb_off2cells)(off) > 1) || (mbyte_cells == 2 && (*mb_off2cells)(off) == 1 *************** *** 5226,5235 **** col += mbyte_cells; ptr += mbyte_blen; if (clear_next_cell) - { ptr = (char_u *)" "; - clear_next_cell = FALSE; - } } else #endif --- 5234,5240 ---- *** ../vim61.095/src/version.c Thu Jun 13 19:43:03 2002 --- src/version.c Tue Jun 18 20:06:45 2002 *************** *** 608,609 **** --- 608,611 ---- { /* Add new patch number below this line */ + /**/ + 96, /**/ -- If VIM were a woman, I'd marry her. Slim, organized, helpful and beautiful; what's not to like? --David A. Rogers /// 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 /// \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///