aboutsummaryrefslogtreecommitdiff
path: root/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/pack/dist/opt/termdebug/plugin/termdebug.vim')
-rw-r--r--runtime/pack/dist/opt/termdebug/plugin/termdebug.vim24
1 files changed, 20 insertions, 4 deletions
diff --git a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim
index a253acc63f..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
@@ -1679,7 +1695,7 @@ func s:CreateBreakpoint(id, subid, enabled)
endif
endif
call sign_define('debugBreakpoint' .. nr,
- \ #{text: strpart(label, 0, 2),
+ \ #{text: slice(label, 0, 2),
\ texthl: hiName})
endif
endfunc