fixing pygdbdir bug
[pygdb.git] / pygdb.vim
index 7a8b89f45901be31ed691ac53b268cb84ef0022d..9486db462b189d6a0ee6a326f6b82dd4c412ddf5 100644 (file)
--- a/pygdb.vim
+++ b/pygdb.vim
@@ -1,4 +1,11 @@
-"shuber, 2008-06-08
+"pygdb.vim - pygtk interface to gdb in connection with (g)vim
+" Maintainer: Stefan Huber <shuber@cosy.sbg.ac.at>
+
+
+if !has('python')
+       echo "Error: Required vim compiled with +python"
+       finish
+endif
 
 if ! exists("g:pygdb")
 
@@ -28,9 +35,17 @@ clientcmd = ""
 execsign = None
 
 def gdbLaunch():
-       global gdbBps, clientcmd
+       global gdbBps, clientcmd, pygdbdir
+
+       clientcmd = vim.eval("input('Client commando: ', '%s')" % clientcmd)
+       
+       #Pressed esq?
+       if clientcmd == None:
+               clientcmd = ""
+               return
 
-       clientcmd = vim.eval("input('Client commando: ', '%s')" % clientcmd).strip()
+       #Strip away white space
+       clientcmd = clientcmd.strip()
 
        if clientcmd.strip()=="":
                print "No command given!"
@@ -198,7 +213,12 @@ def toAbsPath(path):
 
                #We need the client command to expand the paths...
                while clientcmd == "" or not cmdset:
-                       clientcmd = vim.eval("input('Client commando: ', '%s')" % clientcmd).strip()
+                       clientcmd = vim.eval("input('Client commando: ', '%s')" % clientcmd)
+
+                       if clientcmd == None:
+                               clientcmd = ""
+                       clientcmd = clientcmd.strip()
+
                        cmdset = True
 
                #Get the dirs where executeable is in