0
0
mirror of https://github.com/vim/vim.git synced 2025-09-26 04:04:07 -04:00

patch 8.2.0150: cannot define python function when using :execute

Problem:    Cannot define python function when using :execute. (Yasuhiro
            Matsumoto)
Solution:   Do not recognize "def" inside "function.
This commit is contained in:
Bram Moolenaar
2020-01-26 16:50:05 +01:00
parent 8a7d6542b3
commit 673660ab00
3 changed files with 19 additions and 1 deletions

View File

@@ -2667,8 +2667,11 @@ ex_function(exarg_T *eap)
indent += 2;
// Check for defining a function inside this function.
// Only recognize "def" inside "def", not inside "function",
// For backwards compatibility, see Test_function_python().
c = *p;
if (checkforcmd(&p, "function", 2) || checkforcmd(&p, "def", 3))
if (checkforcmd(&p, "function", 2)
|| (eap->cmdidx == CMD_def && checkforcmd(&p, "def", 3)))
{
if (*p == '!')
p = skipwhite(p + 1);