To: vim-dev@vim.org Subject: Patch 6.1.286 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.1.286 Problem: 'showbreak' cannot contain multi-byte characters. Solution: Allow using all single cell characters for 'showbreak'. Files: src/charset.c, src/move.c, src/option.c *** ../vim61.285/src/charset.c Sun Oct 13 20:08:13 2002 --- src/charset.c Sun Dec 29 20:33:57 2002 *************** *** 1079,1085 **** } if (col == 0 || col + size > (colnr_T)W_WIDTH(wp)) { ! added = (int)STRLEN(p_sbr); if (tab_corr) size += (added / wp->w_buffer->b_p_ts) * wp->w_buffer->b_p_ts; else --- 1079,1085 ---- } if (col == 0 || col + size > (colnr_T)W_WIDTH(wp)) { ! added = vim_strsize(p_sbr); if (tab_corr) size += (added / wp->w_buffer->b_p_ts) * wp->w_buffer->b_p_ts; else *** ../vim61.285/src/move.c Thu Jul 4 20:45:15 2002 --- src/move.c Sun Dec 29 20:33:33 2002 *************** *** 1007,1013 **** * mode, the 'showbreak' string isn't shown, backup to first * column */ if (*p_sbr && *ml_get_cursor() == NUL ! && curwin->w_wcol == (int)STRLEN(p_sbr)) curwin->w_wcol = 0; #endif } --- 1007,1013 ---- * mode, the 'showbreak' string isn't shown, backup to first * column */ if (*p_sbr && *ml_get_cursor() == NUL ! && curwin->w_wcol == (int)vim_strsize(p_sbr)) curwin->w_wcol = 0; #endif } *** ../vim61.285/src/option.c Thu Jan 9 21:50:31 2003 --- src/option.c Thu Jan 9 21:58:20 2003 *************** *** 4795,4803 **** /* 'showbreak' */ else if (varp == &p_sbr) { ! for (s = p_sbr; *s; ++s) ! if (byte2cells(*s) != 1) ! errmsg = (char_u *)N_("contains unprintable character"); } #endif --- 4797,4813 ---- /* 'showbreak' */ else if (varp == &p_sbr) { ! for (s = p_sbr; *s; ) ! { ! if (ptr2cells(s) != 1) ! errmsg = (char_u *)N_("contains unprintable or wide character"); ! # ifdef FEAT_MBYTE ! if (has_mbyte) ! s += (*mb_ptr2len_check)(s); ! else ! # endif ! ++s; ! } } #endif *** ../vim61.285/src/version.c Thu Jan 9 21:50:31 2003 --- src/version.c Thu Jan 9 21:54:46 2003 *************** *** 608,609 **** --- 608,611 ---- { /* Add new patch number below this line */ + /**/ + 286, /**/ -- TALL KNIGHT: Firstly. You must get us another shrubbery! OTHER KNIGHTS: More shrubberies! More shrubberies for the ex-Knights of Ni! ARTHUR: Not another shrubbery - "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD /// Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net \\\ /// Creator of Vim - Vi IMproved -- http://www.vim.org \\\ \\\ Project leader for A-A-P -- http://www.a-a-p.org /// \\\ Lord Of The Rings helps Uganda - http://iccf-holland.org/lotr.html ///