patch 8.2.3528: 'thesaurus' and 'thesaurusfunc' do not have the same scope
Problem: 'thesaurus' and 'thesaurusfunc' do not have the same scope.
Solution: Make 'thesaurusfunc' global-local.
diff --git a/src/testdir/test_edit.vim b/src/testdir/test_edit.vim
index 2cce85c..8e4254b 100644
--- a/src/testdir/test_edit.vim
+++ b/src/testdir/test_edit.vim
@@ -920,16 +920,24 @@
func Test_thesaurus_func()
new
- set thesaurus=
- set thesaurusfunc=MyThesaurus
+ set thesaurus=notused
+ set thesaurusfunc=NotUsed
+ setlocal thesaurusfunc=MyThesaurus
call setline(1, "an ki")
call cursor(1, 1)
call feedkeys("A\<c-x>\<c-t>\<c-n>\<cr>\<esc>", 'tnix')
call assert_equal(['an amiable', ''], getline(1, '$'))
+
+ setlocal thesaurusfunc=NonExistingFunc
+ call assert_fails("normal $a\<C-X>\<C-T>", 'E117:')
+
+ setlocal thesaurusfunc=
set thesaurusfunc=NonExistingFunc
call assert_fails("normal $a\<C-X>\<C-T>", 'E117:')
- set thesaurusfunc&
%bw!
+
+ set thesaurusfunc=
+ set thesaurus=
endfunc
func Test_edit_CTRL_U()