mirror of
https://github.com/neovim/neovim.git
synced 2026-02-21 19:06:52 +00:00
vim-patch:partial:9.0.0877: using freed memory with :comclear while listing commands
Problem: Using freed memory with :comclear while listing commands.
Solution: Bail out when the command list has changed. (closes vim/vim#11440)
cf2594fbf3
Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
" Tests for user defined commands
|
||||
|
||||
source check.vim
|
||||
source screendump.vim
|
||||
|
||||
" Test for <mods> in user defined commands
|
||||
function Test_cmdmods()
|
||||
let g:mods = ''
|
||||
@@ -362,6 +365,14 @@ func Test_CmdCompletion()
|
||||
call feedkeys(":com MyCmd chist\<Tab>\<C-B>\"\<CR>", 'tx')
|
||||
call assert_equal("\"com MyCmd chistory", @:)
|
||||
|
||||
" delete the Check commands to avoid them showing up
|
||||
call feedkeys(":com Check\<C-A>\<C-B>\"\<CR>", 'tx')
|
||||
let cmds = substitute(@:, '"com ', '', '')->split()
|
||||
for cmd in cmds
|
||||
exe 'delcommand ' .. cmd
|
||||
endfor
|
||||
delcommand MissingFeature
|
||||
|
||||
command! DoCmd1 :
|
||||
command! DoCmd2 :
|
||||
call feedkeys(":com \<C-A>\<C-B>\"\<CR>", 'tx')
|
||||
@@ -715,7 +726,7 @@ func Test_recursive_define()
|
||||
call DefCmd('Command')
|
||||
|
||||
let name = 'Command'
|
||||
while len(name) < 30
|
||||
while len(name) <= 30
|
||||
exe 'delcommand ' .. name
|
||||
let name ..= 'x'
|
||||
endwhile
|
||||
|
||||
Reference in New Issue
Block a user