]> granicus.if.org Git - vim/commitdiff
patch 8.1.2103: wrong error message if "termdebugger" is not executable v8.1.2103
authorBram Moolenaar <Bram@vim.org>
Mon, 30 Sep 2019 18:47:54 +0000 (20:47 +0200)
committerBram Moolenaar <Bram@vim.org>
Mon, 30 Sep 2019 18:47:54 +0000 (20:47 +0200)
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.

runtime/pack/dist/opt/termdebug/plugin/termdebug.vim
src/version.c

index 8629eb88c0cf51fd27e3c26a772297339dbce602..ce01ae5241ac4155448bc6ae8963d1755e7220ad 100644 (file)
@@ -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
 
index f5b9d6075effb38941c8cc3fa24dadbbd41100bf..fe9cee3a095eb89c8401e81a2774b05b83e48448 100644 (file)
@@ -753,6 +753,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2103,
 /**/
     2102,
 /**/