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/insexpand.c b/src/insexpand.c
index bcaa3fd..6d5e556 100644
--- a/src/insexpand.c
+++ b/src/insexpand.c
@@ -301,7 +301,7 @@
)
: (*curbuf->b_p_tsr == NUL && *p_tsr == NUL
#ifdef FEAT_COMPL_FUNC
- && *curbuf->b_p_tsrfu == NUL
+ && *curbuf->b_p_tsrfu == NUL && *p_tsrfu == NUL
#endif
))
{
@@ -2246,7 +2246,7 @@
case CTRL_X_OMNI:
return curbuf->b_p_ofu;
case CTRL_X_THESAURUS:
- return curbuf->b_p_tsrfu;
+ return *curbuf->b_p_tsrfu == NUL ? p_tsrfu : curbuf->b_p_tsrfu;
default:
return (char_u *)"";
}
@@ -2750,9 +2750,8 @@
thesaurus_func_complete(int type UNUSED)
{
#ifdef FEAT_COMPL_FUNC
- return (type == CTRL_X_THESAURUS
- && curbuf->b_p_tsrfu != NULL
- && *curbuf->b_p_tsrfu != NUL);
+ return type == CTRL_X_THESAURUS
+ && (*curbuf->b_p_tsrfu != NUL || *p_tsrfu != NUL);
#else
return FALSE;
#endif