From e25955fe11da68612055397fc0a0e652b9971377 Mon Sep 17 00:00:00 2001 From: Stefan Huber Date: Tue, 10 Jun 2008 18:30:32 +0200 Subject: [PATCH] fix bug: open non-open files in vim --- pygdb.vim | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/pygdb.vim b/pygdb.vim index 25b7fe1..fc03b84 100644 --- a/pygdb.vim +++ b/pygdb.vim @@ -65,6 +65,16 @@ def gdbToggleBreakpoint(lineno=None, file=None): def addBreakpoint(file, lineno, cond=None): global gdbBps + #If file is not open, open it + if not file in [b.name for b in vim.buffers]: + try: + os.stat(file) + vim.command(":e %s" % file) + except OSError: + print "Warning: file '%s' does not exist! (Wrong client command?)" % file + return + + #Determine a sign number signnum = gdbNewSignnum() @@ -175,6 +185,7 @@ def gdbLoadConfig(): removeBreakpoint(0) #Add breakpoints from configuration + cmdset = False for bp in conf.breakpoints: file = bp["file"] @@ -183,8 +194,9 @@ def gdbLoadConfig(): if file[0] != os.sep: #We need the client command to expand the paths... - while clientcmd == "": + while clientcmd == "" or not cmdset: clientcmd = vim.eval("input('Client commando: ', '%s')" % clientcmd).strip() + cmdset = True #Get the dirs where executeable is in relcmd = string.split(clientcmd)[0] -- 2.39.5