To: vim-dev@vim.org Subject: Patch 6.0aw.008 Fcc: outbox From: Bram Moolenaar ------------ Patch 6.0aw.008 Problem: When the first character of a file name is over 127, the Buffers menu entry would get a negative priority and cause problems. The "Edit.Find" menu didn't work like the "Edit.Find and Replace" menu in Visual mode. The toolbar item for printing didn't work like the Edit.Print menu entry. Solution: Reduce the multiplier for the first character when computing the hash value for a Buffers menu entry. Files: runtime/menu.vim *** ../vim-6.0aw/runtime/menu.vim Sun Sep 16 22:20:43 2001 --- runtime/menu.vim Tue Sep 18 12:28:36 2001 *************** *** 2,8 **** " Note that ":amenu" is often used to make a menu work in all modes. " " Maintainer: Bram Moolenaar ! " Last Change: 2001 Sep 09 " Make sure the '<' and 'C' flags are not included in 'cpoptions', otherwise " would not be recognized. See ":help 'cpoptions'". --- 2,8 ---- " Note that ":amenu" is often used to make a menu work in all modes. " " Maintainer: Bram Moolenaar ! " Last Change: 2001 Sep 18 " Make sure the '<' and 'C' flags are not included in 'cpoptions', otherwise " would not be recognized. See ":help 'cpoptions'". *************** *** 154,159 **** --- 154,161 ---- amenu 20.405 &Edit.-SEP2- : if has("win32") || has("win16") || has("gui_gtk") || has("gui_motif") amenu 20.410 &Edit.&Find\.\.\. :promptfind + vunmenu &Edit.&Find\.\.\. + vmenu &Edit.&Find\.\.\. y:promptfind " amenu 20.420 &Edit.Find\ and\ Rep&lace\.\.\. :promptrepl vunmenu &Edit.Find\ and\ Rep&lace\.\.\. vmenu &Edit.Find\ and\ Rep&lace\.\.\. y:promptrepl " *************** *** 566,572 **** let sp = char2nr(' ') endif " convert first six chars into a number for sorting: ! return (char2nr(nm[0]) - sp) * 0x1000000 + (char2nr(nm[1]) - sp) * 0x40000 + (char2nr(nm[2]) - sp) * 0x1000 + (char2nr(nm[3]) - sp) * 0x40 + (char2nr(nm[4]) - sp) * 0x40 + (char2nr(nm[5]) - sp) endfunc func! s:BMHash2(name) --- 568,574 ---- let sp = char2nr(' ') endif " convert first six chars into a number for sorting: ! return (char2nr(nm[0]) - sp) * 0x800000 + (char2nr(nm[1]) - sp) * 0x20000 + (char2nr(nm[2]) - sp) * 0x1000 + (char2nr(nm[3]) - sp) * 0x80 + (char2nr(nm[4]) - sp) * 0x20 + (char2nr(nm[5]) - sp) endfunc func! s:BMHash2(name) *************** *** 720,737 **** amenu 1.20 ToolBar.Save :w amenu 1.30 ToolBar.SaveAll :wa ! if has("win32") amenu 1.40 ToolBar.Print :hardcopy vunmenu ToolBar.Print vmenu ToolBar.Print :hardcopy elseif has("vms") amenu 1.40 ToolBar.Print :call VMSPrint(":") vunmenu ToolBar.Print ! vmenu ToolBar.Print :call VMSPrint(":'<,'>") ! else ! amenu 1.40 ToolBar.Print :w !lpr ! vunmenu ToolBar.Print ! vmenu ToolBar.Print :w !lpr endif amenu 1.45 ToolBar.-sep1- --- 722,739 ---- amenu 1.20 ToolBar.Save :w amenu 1.30 ToolBar.SaveAll :wa ! if has("printer") amenu 1.40 ToolBar.Print :hardcopy vunmenu ToolBar.Print vmenu ToolBar.Print :hardcopy + elseif has("unix") + amenu 1.40 ToolBar.Print :w !lpr + vunmenu ToolBar.Print + vmenu ToolBar.Print :w !lpr elseif has("vms") amenu 1.40 ToolBar.Print :call VMSPrint(":") vunmenu ToolBar.Print ! vmenu ToolBar.Print :call VMSPrint(":'<,'>") endif amenu 1.45 ToolBar.-sep1- *************** *** 747,754 **** imenu ToolBar.Paste xPaste"_s cmenu ToolBar.Paste + - amenu 1.95 ToolBar.-sep3- if !has("gui_athena") amenu 1.100 ToolBar.Find :promptfind amenu 1.110 ToolBar.FindNext n amenu 1.120 ToolBar.FindPrev N --- 749,756 ---- imenu ToolBar.Paste xPaste"_s cmenu ToolBar.Paste + if !has("gui_athena") + amenu 1.95 ToolBar.-sep3- amenu 1.100 ToolBar.Find :promptfind amenu 1.110 ToolBar.FindNext n amenu 1.120 ToolBar.FindPrev N -- Linux is just like a wigwam: no Windows, no Gates and an Apache inside. /// Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net \\\ ((( Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim ))) \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///