mirror of
https://github.com/neovim/neovim.git
synced 2026-08-19 02:24:46 -05:00
vim-patch:fce324f557: runtime(termdebug): close all buffers in the same way
For ASM and Variables buffer, check were done to make sure they existed before attempting to close them, but not for debugged program or gdb communication. The debugged program window is a user-facing one and user might close it manually, so it's better to check if it exists. https://github.com/vim/vim/commit/fce324f55718192ae7de389bb88d423eed7977a2 Co-authored-by: Damien Riegel <damien@riegel.io> AI-assisted: Codex
This commit is contained in:
committed by
zeertzjq
co-authored by
Damien Riegel
parent
3cd07709ba
commit
34fea4fc64
+10
-6
@@ -227,12 +227,16 @@ endfunc
|
||||
|
||||
" Use when debugger didn't start or ended.
|
||||
func s:CloseBuffers()
|
||||
exe $'bwipe! {s:ptybufnr}'
|
||||
if s:asmbufnr > 0 && bufexists(s:asmbufnr)
|
||||
exe $'bwipe! {s:asmbufnr}'
|
||||
endif
|
||||
if s:varbufnr > 0 && bufexists(s:varbufnr)
|
||||
exe $'bwipe! {s:varbufnr}'
|
||||
for bufnr in [get(s:, 'ptybufnr', 0), get(s:, 'asmbufnr', 0), get(s:, 'varbufnr', 0)]
|
||||
if bufnr > 0 && bufexists(bufnr)
|
||||
execute $'bwipe! {bufnr}'
|
||||
endif
|
||||
endfor
|
||||
if exists('s:comm_job_id')
|
||||
let commbufnr = get(nvim_get_chan_info(s:comm_job_id), 'buffer', 0)
|
||||
if commbufnr > 0 && bufexists(commbufnr)
|
||||
execute $'bwipe! {commbufnr}'
|
||||
endif
|
||||
endif
|
||||
let s:running = v:false
|
||||
unlet! s:gdbwin
|
||||
|
||||
Reference in New Issue
Block a user