diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-09-30 20:47:54 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-09-30 20:47:54 +0200 |
commit | 18223a592efa4399e3951c86deeb712a13b05ca5 (patch) | |
tree | b06e254920891829c82f360dd86722c2e3881171 /runtime | |
parent | d17a57a43330977b8f4eb36f1f7a4a66a7bb26c8 (diff) | |
download | vim-git-18223a592efa4399e3951c86deeb712a13b05ca5.tar.gz |
patch 8.1.2103: wrong error message if "termdebugger" is not executablev8.1.2103
Problem: wrong error message if "termdebugger" is not executable.
Solution: Check if "termdebugger" is executable and give a clear error
message. (Ozaki Kiichi, closes #5000) Fix indents.
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/pack/dist/opt/termdebug/plugin/termdebug.vim | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim index 8629eb88c..ce01ae524 100644 --- a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim +++ b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim @@ -65,8 +65,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 @@ -104,9 +104,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 |