]> granicus.if.org Git - vim/commitdiff
patch 9.0.0960: error when using the "Spelling / Find More Languages" menu v9.0.0960
authorBram Moolenaar <Bram@vim.org>
Sun, 27 Nov 2022 16:18:33 +0000 (16:18 +0000)
committerBram Moolenaar <Bram@vim.org>
Sun, 27 Nov 2022 16:18:33 +0000 (16:18 +0000)
Problem:    Error when using the "Tools / Spelling / Find More Languages"
            menu.
Solution:   Remove "<SID>".  Reset "g:menutrans_set_lang_to" when 'encoding'
            changes. (closes #11625)

runtime/menu.vim
src/version.c

index ab509a69277e15f25ac0c7948a70fdf9c11a685c..59fa12603a079888385a92c05dc059366268602f 100644 (file)
@@ -474,7 +474,7 @@ if has("spell")
   an <silent> 40.335.270 &Tools.&Spelling.&Find\ More\ Languages       :call <SID>SpellLang()<CR>
 
   let s:undo_spelllang = ['aun &Tools.&Spelling.&Find\ More\ Languages']
-  def s:SpellLang()
+  def s:SpellLang(encChanged = false)
     for cmd in s:undo_spelllang
       exe "silent! " .. cmd
     endfor
@@ -482,7 +482,8 @@ if has("spell")
 
     var enc = &enc == "iso-8859-15" ? "latin1" : &enc
 
-    if !exists("g:menutrans_set_lang_to")
+    # Reset g:menutrans_set_lang_to when called for the EncodingChanged event.
+    if !exists("g:menutrans_set_lang_to") || encChanged
       g:menutrans_set_lang_to = 'Set Language to'
     endif
 
@@ -510,12 +511,12 @@ 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()
+    au! EncodingChanged * call SpellLang(true)
     augroup END
   enddef
-
 endif
 
 " Tools.Fold Menu
index cd6f0b6736c7ac90deb7a71a850ae8c2f9e3c16d..a9a0c72a0c5ba03032b4a5e8e670a4a7ea10e4cd 100644 (file)
@@ -695,6 +695,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    960,
 /**/
     959,
 /**/