To: vim-dev@vim.org Subject: Patch 6.1.263 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.1.263 Problem: When typing a multi-byte character that triggers an abbreviation it is not inserted properly. Solution: Handle adding the typed multi-byte character. (Yasuhiro Matsumoto) Files: src/getchar.c *** ../vim61.262/src/getchar.c Mon Oct 14 21:18:12 2002 --- src/getchar.c Tue Nov 19 11:37:12 2002 *************** *** 3749,3755 **** --- 3749,3759 ---- int len; int scol; /* starting column of the abbr. */ int j; + #ifdef FEAT_MBYTE + char_u tb[MB_MAXBYTES + 4]; + #else char_u tb[4]; + #endif mapblock_T *mp; #ifdef FEAT_LOCALMAP mapblock_T *mp2; *************** *** 3867,3877 **** { tb[j++] = K_SPECIAL; tb[j++] = K_SECOND(c); ! c = K_THIRD(c); } - else if (c < ABBR_OFF && (c < ' ' || c > '~')) - tb[j++] = Ctrl_V; /* special char needs CTRL-V */ - tb[j++] = c; tb[j] = NUL; /* insert the last typed char */ (void)ins_typebuf(tb, 1, 0, TRUE, mp->m_silent); --- 3871,3889 ---- { tb[j++] = K_SPECIAL; tb[j++] = K_SECOND(c); ! tb[j++] = K_THIRD(c); ! } ! else ! { ! if (c < ABBR_OFF && (c < ' ' || c > '~')) ! tb[j++] = Ctrl_V; /* special char needs CTRL-V */ ! #ifdef FEAT_MBYTE ! if (has_mbyte) ! j += (*mb_char2bytes)(c, tb + j); ! else ! #endif ! tb[j++] = c; } tb[j] = NUL; /* insert the last typed char */ (void)ins_typebuf(tb, 1, 0, TRUE, mp->m_silent); *** ../vim61.262/src/version.c Tue Nov 19 12:05:12 2002 --- src/version.c Tue Nov 19 13:52:37 2002 *************** *** 608,609 **** --- 608,611 ---- { /* Add new patch number below this line */ + /**/ + 263, /**/ -- hundred-and-one symptoms of being an internet addict: 91. It's Saturday afternoon in the middle of May and you are on computer. /// 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 ///