comparison 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
comparison
equal deleted inserted replaced
21254:44f3da90b7bc 21255:4be91a7eafb2
2748 cmdmod.filter_force = TRUE; 2748 cmdmod.filter_force = TRUE;
2749 p = skipwhite(p + 1); 2749 p = skipwhite(p + 1);
2750 if (*p == NUL || ends_excmd(*p)) 2750 if (*p == NUL || ends_excmd(*p))
2751 break; 2751 break;
2752 } 2752 }
2753 // Avoid that "filter(arg)" is recognized.
2754 if (in_vim9script() && !VIM_ISWHITE(*p))
2755 break;
2756
2753 if (skip_only) 2757 if (skip_only)
2754 p = skip_vimgrep_pat(p, NULL, NULL); 2758 p = skip_vimgrep_pat(p, NULL, NULL);
2755 else 2759 else
2756 // NOTE: This puts a NUL after the pattern. 2760 // NOTE: This puts a NUL after the pattern.
2757 p = skip_vimgrep_pat(p, &reg_pat, NULL); 2761 p = skip_vimgrep_pat(p, &reg_pat, NULL);
2902 2906
2903 return OK; 2907 return OK;
2904 } 2908 }
2905 2909
2906 /* 2910 /*
2907 * Unod and free contents of "cmdmod". 2911 * Undo and free contents of "cmdmod".
2908 */ 2912 */
2909 void 2913 void
2910 undo_cmdmod(exarg_T *eap, int save_msg_scroll) 2914 undo_cmdmod(exarg_T *eap, int save_msg_scroll)
2911 { 2915 {
2912 if (eap->verbose_save >= 0) 2916 if (eap->verbose_save >= 0)