diff runtime/pack/dist/opt/termdebug/plugin/termdebug.vim @ 18217:40344f717010 v8.1.2103

patch 8.1.2103: wrong error message if "termdebugger" is not executable Commit: https://github.com/vim/vim/commit/18223a592efa4399e3951c86deeb712a13b05ca5 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Sep 30 20:47:54 2019 +0200 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 #5000) Fix indents.
author Bram Moolenaar <Bram@vim.org>
date Mon, 30 Sep 2019 21:00:04 +0200
parents 1e5672da6a69
children 82a28df1e2d5
line wrap: on
line diff
--- 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 Te
 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