diff options
author | Ubaldo Tiberi <ubaldo.tiberi@volvo.com> | 2024-05-21 23:33:03 +0200 |
---|---|---|
committer | Christian Brabandt <cb@256bit.org> | 2024-05-21 23:33:03 +0200 |
commit | 62ccaa60d5f7f9a13c758bd5e55b7ca6855a6de9 (patch) | |
tree | 451169a11bc5014997114b29cef9ff1842850f8f /runtime | |
parent | d1d9316c6621d275593f58664975faf0fc23985f (diff) |
runtime(termdebug): check for gdb file/dir before using as buffer name
Add test so that this doesn't regress.
fixes: #12718
closes: #14792
Signed-off-by: Ubaldo Tiberi <ubaldo.tiberi@volvo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/pack/dist/opt/termdebug/plugin/termdebug.vim | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim index 50833f0df0..8eb3fff694 100644 --- a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim +++ b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim @@ -415,7 +415,17 @@ func s:StartDebug_prompt(dict) let s:promptbuf = bufnr('') call prompt_setprompt(s:promptbuf, 'gdb> ') set buftype=prompt - file gdb + + if empty(glob('gdb')) + file gdb + elseif empty(glob('Termdebug-gdb-console')) + file Termdebug-gdb-console + else + call s:Echoerr("You have a file/folder named 'gdb' + \ or 'Termdebug-gdb-console'. + \ Please exit and rename them because Termdebug may not work as expected.") + endif + call prompt_setcallback(s:promptbuf, function('s:PromptCallback')) call prompt_setinterrupt(s:promptbuf, function('s:PromptInterrupt')) @@ -1463,9 +1473,12 @@ func s:GotoAsmwinOrCreateIt() if s:asmbuf > 0 && bufexists(s:asmbuf) exe 'buffer' . s:asmbuf - else + elseif empty(glob('Termdebug-asm-listing')) silent file Termdebug-asm-listing let s:asmbuf = bufnr('Termdebug-asm-listing') + else + call s:Echoerr("You have a file/folder named 'Termdebug-asm-listing'. + \ Please exit and rename it because Termdebug may not work as expected.") endif if mdf != 'vert' && s:GetDisasmWindowHeight() > 0 @@ -1532,9 +1545,12 @@ func s:GotoVariableswinOrCreateIt() if s:varbuf > 0 && bufexists(s:varbuf) exe 'buffer' . s:varbuf - else + elseif empty(glob('Termdebug-variables-listing')) silent file Termdebug-variables-listing let s:varbuf = bufnr('Termdebug-variables-listing') + else + call s:Echoerr("You have a file/folder named 'Termdebug-variables-listing'. + \ Please exit and rename it because Termdebug may not work as expected.") endif if mdf != 'vert' && s:GetVariablesWindowHeight() > 0 |