changeset 31253:0257c9dedf56 v9.0.0960

patch 9.0.0960: error when using the "Spelling / Find More Languages" menu Commit: https://github.com/vim/vim/commit/502e91756e99181d5fe668fad2e868dc7f3f4fea Author: Bram Moolenaar <Bram@vim.org> Date: Sun Nov 27 16:18:33 2022 +0000 patch 9.0.0960: error when using the "Spelling / Find More Languages" menu 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)
author Bram Moolenaar <Bram@vim.org>
date Sun, 27 Nov 2022 17:30:03 +0100
parents 486b3696206f
children fac14d7d7c2b
files runtime/menu.vim src/version.c
diffstat 2 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/runtime/menu.vim
+++ b/runtime/menu.vim
@@ -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
--- a/src/version.c
+++ b/src/version.c
@@ -696,6 +696,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    960,
+/**/
     959,
 /**/
     958,