Mercurial > vim
comparison src/testdir/test_cmdline.vim @ 31394:a6b1f1c22374 v9.0.1030
patch 9.0.1030: using freed memory with the cmdline popup menu
Commit: https://github.com/vim/vim/commit/038e6d20e680ce8c850d07f6b035c4e1904c1201
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Dec 8 12:00:50 2022 +0000
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 https://github.com/vim/vim/issues/11677)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 08 Dec 2022 13:15:03 +0100 |
parents | b0596e8ee3c0 |
children | a5561303189e |
comparison
equal
deleted
inserted
replaced
31393:d738837013df | 31394:a6b1f1c22374 |
---|---|
2483 call VerifyScreenDump(buf, 'Test_wildmenu_pum_term_01', {}) | 2483 call VerifyScreenDump(buf, 'Test_wildmenu_pum_term_01', {}) |
2484 call term_wait(buf) | 2484 call term_wait(buf) |
2485 call StopVimInTerminal(buf) | 2485 call StopVimInTerminal(buf) |
2486 endfunc | 2486 endfunc |
2487 | 2487 |
2488 func Test_wildmenu_pum_clear_entries() | |
2489 " This was using freed memory. Run in a terminal to get the pum to update. | |
2490 let lines =<< trim END | |
2491 set wildoptions=pum | |
2492 set wildchar=<C-E> | |
2493 END | |
2494 call writefile(lines, 'XwildmenuTest', 'D') | |
2495 let buf = RunVimInTerminal('-S XwildmenuTest', #{rows: 10}) | |
2496 | |
2497 call term_sendkeys(buf, ":\<C-E>\<C-E>") | |
2498 call VerifyScreenDump(buf, 'Test_wildmenu_pum_clear_entries_1', {}) | |
2499 | |
2500 set wildoptions& wildchar& | |
2501 endfunc | |
2502 | |
2488 " Test for completion after a :substitute command followed by a pipe (|) | 2503 " Test for completion after a :substitute command followed by a pipe (|) |
2489 " character | 2504 " character |
2490 func Test_cmdline_complete_substitute() | 2505 func Test_cmdline_complete_substitute() |
2491 call feedkeys(":s | \t\<C-B>\"\<CR>", 'xt') | 2506 call feedkeys(":s | \t\<C-B>\"\<CR>", 'xt') |
2492 call assert_equal("\"s | \t", @:) | 2507 call assert_equal("\"s | \t", @:) |