diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-12-08 12:00:50 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-12-08 12:00:50 +0000 |
commit | 038e6d20e680ce8c850d07f6b035c4e1904c1201 (patch) | |
tree | 6d91f0c3505d285296e0c4078cd8e2e7775e08a3 /src/testdir/test_cmdline.vim | |
parent | 84dbf855fb2d883481f74ad0ccf3df3f8837e6bf (diff) | |
download | vim-git-038e6d20e680ce8c850d07f6b035c4e1904c1201.tar.gz |
patch 9.0.1030: using freed memory with the cmdline popup menuv9.0.1030
Problem: Using freed memory with the cmdline popup menu.
Solution: Clear the popup menu when clearing the matches. (closes #11677)
Diffstat (limited to 'src/testdir/test_cmdline.vim')
-rw-r--r-- | src/testdir/test_cmdline.vim | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/testdir/test_cmdline.vim b/src/testdir/test_cmdline.vim index ddc235d1e..28f845a9a 100644 --- a/src/testdir/test_cmdline.vim +++ b/src/testdir/test_cmdline.vim @@ -2485,6 +2485,21 @@ func Test_wildmenu_pum_from_terminal() call StopVimInTerminal(buf) endfunc +func Test_wildmenu_pum_clear_entries() + " This was using freed memory. Run in a terminal to get the pum to update. + let lines =<< trim END + set wildoptions=pum + set wildchar=<C-E> + END + call writefile(lines, 'XwildmenuTest', 'D') + let buf = RunVimInTerminal('-S XwildmenuTest', #{rows: 10}) + + call term_sendkeys(buf, ":\<C-E>\<C-E>") + call VerifyScreenDump(buf, 'Test_wildmenu_pum_clear_entries_1', {}) + + set wildoptions& wildchar& +endfunc + " Test for completion after a :substitute command followed by a pipe (|) " character func Test_cmdline_complete_substitute() |