vim-patch:8.1.2103: wrong error message if "termdebugger" is not executable

Problem:    wrong error message if "termdebugger" is not executable.
Solution:   Check if "termdebugger" is executable and give a clear error
            message. (Ozaki Kiichi, closes vim/vim#5000)  Fix indents.
18223a592e
This commit is contained in:
Jan Edmund Lazo
2019-09-30 20:17:11 -04:00
parent 655085204e
commit efef797126

View File

@@ -67,8 +67,8 @@ command -nargs=* -complete=file -bang Termdebug call s:StartDebug(<bang>0, <f-ar
command -nargs=+ -complete=file -bang TermdebugCommand call s:StartDebugCommand(<bang>0, <f-args>)
" Name of the gdb command, defaults to "gdb".
if !exists('termdebugger')
let termdebugger = 'gdb'
if !exists('g:termdebugger')
let g:termdebugger = 'gdb'
endif
let s:pc_id = 12
@@ -106,9 +106,14 @@ endfunc
func s:StartDebug_internal(dict)
if exists('s:gdbwin')
echoerr 'Terminal debugger already running'
echoerr 'Terminal debugger already running, cannot run two'
return
endif
if !executable(g:termdebugger)
echoerr 'Cannot execute debugger program "' .. g:termdebugger .. '"'
return
endif
let s:ptywin = 0
let s:pid = 0