diff options
author | Bram Moolenaar <Bram@vim.org> | 2005-07-30 22:43:24 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2005-07-30 22:43:24 +0000 |
commit | 5a8684e7821a35e371b845b60699df527a855a9f (patch) | |
tree | f43514fa375c03008e73c573c1d55d54c00e775e /runtime/menu.vim | |
parent | 3a6c56e422af98290f81592a1565991d912afcd3 (diff) | |
download | vim-git-5a8684e7821a35e371b845b60699df527a855a9f.tar.gz |
updated for version 7.0120
Diffstat (limited to 'runtime/menu.vim')
-rw-r--r-- | runtime/menu.vim | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/runtime/menu.vim b/runtime/menu.vim index 37bd11ac2..52607235c 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: 2005 Jul 22 +" Last Change: 2005 Jul 30 " 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. @@ -424,22 +424,30 @@ if has("spell") an 40.335.260 &Tools.&Spelling.Set\ language\ to\ "en_us" :set spl=en_us spell<CR> an <silent> 40.335.270 &Tools.&Spelling.&Find\ More\ Languages :call <SID>SpellLang()<CR> + let s:undo_spellang = ['aun &Tools.&Spelling.&Find\ More\ Languages'] func! s:SpellLang() - silent! aun &Tools.&Spelling.&Find\ More\ Languages + for cmd in s:undo_spellang + exe "silent! " . cmd + endfor + let s:undo_spellang = [] + if &enc == "iso-8859-15" let enc = "latin1" else let enc = &enc endif + let found = 0 let s = globpath(&rtp, "spell/*." . enc . ".spl") if s != "" let n = 300 for f in split(s, "\n") let nm = substitute(f, '.*spell[/\\]\(..\)\.[^/\\]*\.spl', '\1', "") - if nm != "en" - exe 'an 40.335.' . n . ' &Tools.&Spelling.Set\ language\ to\ "' . nm . '" :set spl=' . nm . ' spell<CR>' + if nm != "en" && nm !~ '/' let found += 1 + let menuname = '&Tools.&Spelling.Set\ language\ to\ "' . nm . '"' + exe 'an 40.335.' . n . ' ' . menuname . ' :set spl=' . nm . ' spell<CR>' + let s:undo_spellang += ['aun ' . menuname] endif let n += 10 endfor @@ -451,6 +459,10 @@ if has("spell") else echomsg "Found " . found . " more spell files" endif + " Need to redo this when 'encoding' is changed. + augroup spellmenu + au! EncodingChanged * call <SID>SpellLang() + augroup END endfun endif |