Mercurial > vim
diff src/userfunc.c @ 10573:3f777388b6ad v8.0.0176
patch 8.0.0176: cannot use :change inside a function definition
commit https://github.com/vim/vim/commit/70bcd7336f9f19304f32c52a86ed5b4b3de852c2
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Jan 12 22:20:54 2017 +0100
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 https://github.com/vim/vim/issues/1374)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 12 Jan 2017 22:30:04 +0100 |
parents | 66f1b5bf3fa6 |
children | 7598ce51bf2a |
line wrap: on
line diff
--- 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'))))))