~ubuntu-branches/ubuntu/maverick/vim/maverick

« back to all changes in this revision

Viewing changes to runtime/menu.vim

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson
  • Date: 2008-06-26 13:42:18 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20080626134218-703edeyb8k70qpbz
Tags: 1:7.1.314-3ubuntu1
* Resynchronise with Debian. Remaining changes:
  - Enable detection of GNU screen as a mouse-capable terminal.
  - Add NoDisplay=true to gvim.desktop.
  - Drop vim-lesstif package and lesstif2-dev build-dependency.
  - Build-depend on libxt-dev.
  - Enable Python interpreter on basic builds.
  - Create a .pot file for translations.
  - Disable autoindent, line-wrapping, and backup files by default.
* Fixes various vulnerabilities due to improper quoting of 'execute'
  arguments (LP: #240216).
* Drop fixes for upgrade problems from Ubuntu 6.06 LTS; direct upgrades
  from 6.06 to 8.10 will not be supported.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
" You can also use this as a start for your own set of menus.
3
3
"
4
4
" Maintainer:   Bram Moolenaar <Bram@vim.org>
5
 
" Last Change:  2007 Nov 19
 
5
" Last Change:  2008 May 29
6
6
 
7
7
" Note that ":an" (short for ":anoremenu") is often used to make a menu work
8
8
" in all modes and avoid side effects from mappings defined by the user.
135
135
  exe "norm gg" . (&slm == "" ? "VG" : "gH\<C-O>G")
136
136
endfunc
137
137
 
 
138
func! s:FnameEscape(fname)
 
139
  if exists('*fnameescape')
 
140
    return fnameescape(a:fname)
 
141
  return escape(a:fname, " \t\n*?[{`$\\%#'\"|!<")
 
142
endfunc
138
143
 
139
144
" Edit menu
140
145
an 20.310 &Edit.&Undo<Tab>u                     u
193
198
  else
194
199
    let fname = "$HOME/.vimrc"
195
200
  endif
 
201
  let fname = s:FnameEscape(fname)
196
202
  if &mod
197
203
    exe "split " . fname
198
204
  else
806
812
      if @% == ""
807
813
        20vsp .
808
814
      else
809
 
        exe "20vsp " . expand("%:p:h")
 
815
        exe "20vsp " . s:FnameEscape(expand("%:p:h"))
810
816
      endif
811
817
    endfun
812
818
  endif
1028
1034
" Select a session to load; default to current session name if present
1029
1035
fun! s:LoadVimSesn()
1030
1036
  if strlen(v:this_session) > 0
1031
 
    let name = escape(v:this_session, ' \t#%$|<>"*?[{`')
 
1037
    let name = s:FnameEscape(v:this_session)
1032
1038
  else
1033
1039
    let name = "Session.vim"
1034
1040
  endif
1040
1046
  if strlen(v:this_session) == 0
1041
1047
    let v:this_session = "Session.vim"
1042
1048
  endif
1043
 
  execute "browse mksession! " . escape(v:this_session, ' \t#%$|<>"*?[{`')
 
1049
  execute "browse mksession! " . s:FnameEscape(v:this_session)
1044
1050
endfun
1045
1051
 
1046
1052
endif