diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-12-08 20:11:39 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2022-12-09 02:16:57 +0800 |
commit | 4d22424d9ecdb7c2485a1d7272e1b75e69386891 (patch) | |
tree | 4323fa6632e8289e00d2d556feb7f38327043fe6 /src/nvim/cmdexpand.c | |
parent | 9b14ad5fd9e15718aa938f7a426dddcc2edab4e3 (diff) | |
download | rneovim-4d22424d9ecdb7c2485a1d7272e1b75e69386891.tar.gz rneovim-4d22424d9ecdb7c2485a1d7272e1b75e69386891.tar.bz2 rneovim-4d22424d9ecdb7c2485a1d7272e1b75e69386891.zip |
vim-patch:9.0.1030: using freed memory with the cmdline popup menu
Problem: Using freed memory with the cmdline popup menu.
Solution: Clear the popup menu when clearing the matches. (closes vim/vim#11677)
https://github.com/vim/vim/commit/038e6d20e680ce8c850d07f6b035c4e1904c1201
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'src/nvim/cmdexpand.c')
-rw-r--r-- | src/nvim/cmdexpand.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/nvim/cmdexpand.c b/src/nvim/cmdexpand.c index 9619c81636..ca732c6cd9 100644 --- a/src/nvim/cmdexpand.c +++ b/src/nvim/cmdexpand.c @@ -745,6 +745,11 @@ char *ExpandOne(expand_T *xp, char *str, char *orig, int options, int mode) FreeWild(xp->xp_numfiles, xp->xp_files); xp->xp_numfiles = -1; XFREE_CLEAR(orig_save); + + // The entries from xp_files may be used in the PUM, remove it. + if (compl_match_array != NULL) { + cmdline_pum_remove(); + } } findex = 0; |