fixing pygdbdir bug
[pygdb.git] / pygdb.vim
index 642b327f7c5d545bc5c1d431d395d88ce1967f50..9486db462b189d6a0ee6a326f6b82dd4c412ddf5 100644 (file)
--- a/pygdb.vim
+++ b/pygdb.vim
@@ -35,9 +35,17 @@ clientcmd = ""
 execsign = None
 
 def gdbLaunch():
-       global gdbBps, clientcmd
+       global gdbBps, clientcmd, pygdbdir
 
-       clientcmd = vim.eval("input('Client commando: ', '%s')" % clientcmd).strip()
+       clientcmd = vim.eval("input('Client commando: ', '%s')" % clientcmd)
+       
+       #Pressed esq?
+       if clientcmd == None:
+               clientcmd = ""
+               return
+
+       #Strip away white space
+       clientcmd = clientcmd.strip()
 
        if clientcmd.strip()=="":
                print "No command given!"
@@ -205,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