0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.2.3347: check for legacy script is incomplete

Problem:    Check for legacy script is incomplete. (Naohiro Ono)
Solution:   Also check the :legacy modifier.  Use for string concatenation
            with "." and others (issue #8756)
This commit is contained in:
Bram Moolenaar
2021-08-15 13:49:42 +02:00
parent 2596a4e763
commit dd9de50f42
9 changed files with 77 additions and 9 deletions

View File

@@ -33,6 +33,18 @@ in_vim9script(void)
}
#if defined(FEAT_EVAL) || defined(PROTO)
/*
* Return TRUE when currently in a script with script version smaller than
* "max_version" or command modifiers forced it.
*/
int
in_old_script(int max_version)
{
return (current_sctx.sc_version <= max_version
&& !(cmdmod.cmod_flags & CMOD_VIM9CMD))
|| (cmdmod.cmod_flags & CMOD_LEGACY);
}
/*
* Return TRUE if the current script is Vim9 script.
* This also returns TRUE in a legacy function in a Vim9 script.