aboutsummaryrefslogtreecommitdiff
path: root/runtime/pack
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-05-22 08:41:07 +0800
committerGitHub <noreply@github.com>2024-05-22 08:41:07 +0800
commit10601ac5fa3cf3d26f315873dab4384045999c7f (patch)
treef82603fdf2a69f51fe66586f0dcd779ad4268cb1 /runtime/pack
parentd6be78cc98c49076f8b6c5b641b7ed403f4377c5 (diff)
downloadrneovim-10601ac5fa3cf3d26f315873dab4384045999c7f.tar.gz
rneovim-10601ac5fa3cf3d26f315873dab4384045999c7f.tar.bz2
rneovim-10601ac5fa3cf3d26f315873dab4384045999c7f.zip
vim-patch:62ccaa6: runtime(termdebug): check for gdb file/dir before using as buffer name (#28908)
Add test so that this doesn't regress. fixes: vim/vim#12718 closes: vim/vim#14792 https://github.com/vim/vim/commit/62ccaa60d5f7f9a13c758bd5e55b7ca6855a6de9 Co-authored-by: Ubaldo Tiberi <ubaldo.tiberi@volvo.com>
Diffstat (limited to 'runtime/pack')
-rw-r--r--runtime/pack/dist/opt/termdebug/plugin/termdebug.vim22
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 89d0874b9e..f78a082cb7 100644
--- a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim
+++ b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim
@@ -427,7 +427,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'))
@@ -1481,9 +1491,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
@@ -1550,9 +1563,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