X-Git-Url: https://git.sthu.org/?a=blobdiff_plain;ds=sidebyside;f=pygdb.vim;h=872db2374769ecc3019122d3190e73eebacf6117;hb=7689c8fe779e388f85d3122e77d990414f9097f3;hp=80cf77dbda77a47727df8bd5687e5da378a2acdd;hpb=8a09be35138b09a6871dfc323a9e6e3a825a286b;p=pygdb.git diff --git a/pygdb.vim b/pygdb.vim index 80cf77d..872db23 100644 --- a/pygdb.vim +++ b/pygdb.vim @@ -9,6 +9,7 @@ let s:ScriptLocation = expand("") python << >> import gtk +import os import string import sys import threading @@ -23,7 +24,8 @@ import Configuration -#Breakpoint positions: List of dictionaries of form {"signnum" : , "file" : , "lineno":, "cond" : } +#Breakpoint positions: List of dictionaries of form +#{"signnum" : , "file" : , "lineno":, "cond" : } gdbBps = [] signnum = 0 clientcmd = "" @@ -56,7 +58,7 @@ def gdbToggleBreakpoint(lineno=None, file=None): if lineno==None: lineno = vim.current.window.cursor[0] if file==None: - file = vim.current.window.buffer.name + file = getCurrentFile() #Determine index of breakpoint bpidx = gdbGetBreakpoint( file, lineno ) @@ -84,7 +86,7 @@ def gdbBreakpointCond(lineno=None, file=None, cond=None): if lineno==None: lineno = vim.current.window.cursor[0] if file==None: - file = vim.current.window.buffer.name + file = getCurrentFile() #Determine index of breakpoint bpidx = gdbGetBreakpoint( file, lineno ) @@ -109,6 +111,11 @@ def gdbBreakpointCond(lineno=None, file=None, cond=None): gdbBps += [b] +def getCurrentFile(): + return vim.current.window.buffer.name + + + def gdbNewSignnum(): global signnum signnum += 1 @@ -125,10 +132,8 @@ def gdbGetBreakpoint(file, lineno): >> -highlight ExecutionLine term=bold ctermbg=DarkGreen ctermfg=White highlight BreakPoint term=inverse ctermbg=DarkCyan ctermfg=Black -sign define ExecutionLine text==> texthl=ExecutionLine linehl=ExecutionLine sign define BreakPoint text=! texthl=BreakPoint linehl=BreakPoint sign define CondBreakPoint text=? texthl=BreakPoint linehl=BreakPoint