diff options
author | Bram Moolenaar <Bram@vim.org> | 2008-06-25 20:13:35 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2008-06-25 20:13:35 +0000 |
commit | aba8857aa3dac629dc9c2a61c70bceee8b095e14 (patch) | |
tree | d2ba4671d3af28fb2b87110b7eae7b573f257904 /runtime/menu.vim | |
parent | 7b6d4a8ce837e4a0b8484dbbacb4ebcc9995f6fb (diff) | |
download | vim-git-aba8857aa3dac629dc9c2a61c70bceee8b095e14.tar.gz |
updated for version 7.2a-00v7.2a.00
Diffstat (limited to 'runtime/menu.vim')
-rw-r--r-- | runtime/menu.vim | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/runtime/menu.vim b/runtime/menu.vim index f0c0d699c..d120ce293 100644 --- a/runtime/menu.vim +++ b/runtime/menu.vim @@ -2,7 +2,7 @@ " You can also use this as a start for your own set of menus. " " Maintainer: Bram Moolenaar <Bram@vim.org> -" Last Change: 2007 Nov 19 +" Last Change: 2008 Jun 16 " 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. @@ -135,6 +135,11 @@ func! <SID>SelectAll() exe "norm gg" . (&slm == "" ? "VG" : "gH\<C-O>G") endfunc +func! s:FnameEscape(fname) + if exists('*fnameescape') + return fnameescape(a:fname) + return escape(a:fname, " \t\n*?[{`$\\%#'\"|!<") +endfunc " Edit menu an 20.310 &Edit.&Undo<Tab>u u @@ -193,6 +198,7 @@ fun! s:EditVimrc() else let fname = "$HOME/.vimrc" endif + let fname = s:FnameEscape(fname) if &mod exe "split " . fname else @@ -806,7 +812,7 @@ if has("vertsplit") if @% == "" 20vsp . else - exe "20vsp " . expand("%:p:h") + exe "20vsp " . s:FnameEscape(expand("%:p:h")) endif endfun endif @@ -1028,7 +1034,7 @@ endif " Select a session to load; default to current session name if present fun! s:LoadVimSesn() if strlen(v:this_session) > 0 - let name = escape(v:this_session, ' \t#%$|<>"*?[{`') + let name = s:FnameEscape(v:this_session) else let name = "Session.vim" endif @@ -1040,7 +1046,7 @@ fun! s:SaveVimSesn() if strlen(v:this_session) == 0 let v:this_session = "Session.vim" endif - execute "browse mksession! " . escape(v:this_session, ' \t#%$|<>"*?[{`') + execute "browse mksession! " . s:FnameEscape(v:this_session) endfun endif |