summaryrefslogtreecommitdiff
path: root/src/userfunc.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-01-12 22:20:54 +0100
committerBram Moolenaar <Bram@vim.org>2017-01-12 22:20:54 +0100
commit70bcd7336f9f19304f32c52a86ed5b4b3de852c2 (patch)
treec86ac70eb20a379b25b68ddab914393c25e04fa6 /src/userfunc.c
parent972c3b8f1b50e2f887a397c324af99eb354aad0b (diff)
downloadvim-70bcd7336f9f19304f32c52a86ed5b4b3de852c2.zip
patch 8.0.0176: cannot use :change inside a function definition
Problem: Using :change in between :function and :endfunction fails. Solution: Recognize :change inside a function. (ichizok, closes #1374)
Diffstat (limited to 'src/userfunc.c')
-rw-r--r--src/userfunc.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/userfunc.c b/src/userfunc.c
index 369d92ad6..372c9bb86 100644
--- a/src/userfunc.c
+++ b/src/userfunc.c
@@ -2085,9 +2085,14 @@ ex_function(exarg_T *eap)
}
}
- /* Check for ":append" or ":insert". */
+ /* Check for ":append", ":change", ":insert". */
p = skip_range(p, NULL);
if ((p[0] == 'a' && (!ASCII_ISALPHA(p[1]) || p[1] == 'p'))
+ || (p[0] == 'c'
+ && (!ASCII_ISALPHA(p[1]) || (p[1] == 'h'
+ && (!ASCII_ISALPHA(p[2]) || (p[2] == 'a'
+ && (STRNCMP(&p[3], "nge", 3) != 0
+ || !ASCII_ISALPHA(p[6])))))))
|| (p[0] == 'i'
&& (!ASCII_ISALPHA(p[1]) || (p[1] == 'n'
&& (!ASCII_ISALPHA(p[2]) || (p[2] == 's'))))))