Mercurial > vim
diff src/ex_docmd.c @ 21255:4be91a7eafb2 v8.2.1178
patch 8.2.1178: Vim9: filter function recognized as command modifier
Commit: https://github.com/vim/vim/commit/b074e8b8d4d3cefefc675dfaf3982d388ee07772
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jul 11 13:40:45 2020 +0200
patch 8.2.1178: Vim9: filter function recognized as command modifier
Problem: Vim9: filter function recognized as command modifier, leading to a
crash.
Solution: Clear cmdmod after freeing items. Do not recognize a command
modifier followed by non-white space. (closes #6434)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 11 Jul 2020 13:45:04 +0200 |
parents | 874a28fac941 |
children | ee0e2ada88c0 |
line wrap: on
line diff
--- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -2750,6 +2750,10 @@ parse_command_modifiers(exarg_T *eap, ch if (*p == NUL || ends_excmd(*p)) break; } + // Avoid that "filter(arg)" is recognized. + if (in_vim9script() && !VIM_ISWHITE(*p)) + break; + if (skip_only) p = skip_vimgrep_pat(p, NULL, NULL); else @@ -2904,7 +2908,7 @@ parse_command_modifiers(exarg_T *eap, ch } /* - * Unod and free contents of "cmdmod". + * Undo and free contents of "cmdmod". */ void undo_cmdmod(exarg_T *eap, int save_msg_scroll)