To: vim-dev@vim.org Subject: Patch 6.1.258 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.1.258 Problem: Buffers menu doesn't work properly for multibyte buffer names. Solution: Use a pattern to get the left and right part of the name. (Yasuhiro Matsumoto) Files: runtime/menu.vim *** ../vim61.257/runtime/menu.vim Sat Aug 24 23:19:56 2002 --- runtime/menu.vim Sun Nov 17 22:12:44 2002 *************** *** 2,8 **** " You can also use this as a start for your own set of menus. " " Maintainer: Bram Moolenaar ! " Last Change: 2002 Aug 23 " Note that ":an" (short for ":anoremenu") is often used to make a menu work " in all modes and avoid side effects from mappings defined by the user. --- 2,8 ---- " You can also use this as a start for your own set of menus. " " Maintainer: Bram Moolenaar ! " Last Change: 2002 Nov 17 " Note that ":an" (short for ":anoremenu") is often used to make a menu work " in all modes and avoid side effects from mappings defined by the user. *************** *** 665,675 **** else let len = strlen(name) if len > g:bmenu_max_pathlen ! let amount = (g:bmenu_max_pathlen / 2) - 2 ! let left = strpart(name, 0, amount) ! let amount = g:bmenu_max_pathlen - amount - 3 ! let right = strpart(name, len - amount, amount) ! let name = left . '...' . right endif endif return name --- 665,678 ---- else let len = strlen(name) if len > g:bmenu_max_pathlen ! let amountl = (g:bmenu_max_pathlen / 2) - 2 ! let amountr = g:bmenu_max_pathlen - amountl - 3 ! let pattern = '^\(.\{,' . amountl . '}\).\{-}\(.\{,' . amountr . '}\)$' ! let left = substitute(name, pattern, '\1', '') ! let right = substitute(name, pattern, '\2', '') ! if strlen(left) + strlen(right) < len ! let name = left . '...' . right ! endif endif endif return name *** ../vim61.257/src/version.c Tue Nov 19 11:21:32 2002 --- src/version.c Tue Nov 19 11:43:51 2002 *************** *** 608,609 **** --- 608,611 ---- { /* Add new patch number below this line */ + /**/ + 258, /**/ -- Ed's Radiator Shop: The Best Place in Town to Take a Leak. /// 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 ///