To: vim-dev@vim.org Subject: Patch 6.1.102 Fcc: outbox From: Bram Moolenaar MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.1.102 Problem: Unprintable and multi-byte characters in a statusline item are not truncated correctly. (Yasuhiro Matsumoto) Solution: Count the width of characters instead of the number of bytes. Files: src/buffer.c *** ../vim61.101/src/buffer.c Sun Apr 21 15:51:07 2002 --- src/buffer.c Wed Jun 12 21:41:21 2002 *************** *** 3252,3263 **** t++; prevchar_isflag = TRUE; } ! l = (long)STRLEN(t); if (l > 0) prevchar_isitem = TRUE; if (l > maxwid) { ! t += (l - maxwid + 1); *p++ = '<'; } if (minwid > 0) --- 3260,3280 ---- t++; prevchar_isflag = TRUE; } ! l = (long)vim_strsize(t); if (l > 0) prevchar_isitem = TRUE; if (l > maxwid) { ! while (l >= maxwid) ! #ifdef FEAT_MBYTE ! if (has_mbyte) ! { ! l -= ptr2cells(s); ! t += (*mb_ptr2len_check)(t); ! } ! else ! #endif ! l -= byte2cells(*t++); *p++ = '<'; } if (minwid > 0) *** ../vim61.101/src/version.c Sun Jun 23 12:49:34 2002 --- src/version.c Sun Jun 23 13:03:13 2002 *************** *** 608,609 **** --- 608,611 ---- { /* Add new patch number below this line */ + /**/ + 102, /**/ -- If I tell you "you have a beautiful body", would you hold it against me? /// 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 ///