Permalink
Browse files

Set DBGP features with Vim features dictionary

When a debugging session is started, all features added to
g:vdebug_features are sent to the debugger engine. Exceptions thrown by
invalid features are caught and shown to the user.
  • Loading branch information...
joonty committed Mar 6, 2013
1 parent 5f38920 commit 8f24e5c810d201de0dd5f2b032a29f62ec4c2911
Showing with 13 additions and 0 deletions.
  1. +11 −0 plugin/python/vdebug/runner.py
  2. +2 −0 plugin/vdebug.vim
@@ -30,6 +30,7 @@ def open(self):
connection or vdebug.ui is used.
"""
vdebug.opts.Options.set(vim.eval('g:vdebug_options'))
+
if vdebug.opts.Options.isset('debug_file'):
vdebug.log.Log.set_logger(vdebug.log.FileLogger(\
vdebug.opts.Options.get('debug_file_level'),\
@@ -50,6 +51,7 @@ def open(self):
vdebug.log.Log("Found connection from " + str(addr),vdebug.log.Logger.INFO)
self.ui.set_conn_details(addr[0],addr[1])
+ self.set_features()
self.breakpoints.update_lines(self.ui.get_breakpoint_sign_positions())
self.breakpoints.link_api(self.api)
@@ -64,6 +66,15 @@ def open(self):
status = self.api.run()
self.refresh(status)
+ def set_features(self):
+ features = vim.eval('g:vdebug_features')
+ for name, value in features.iteritems():
+ try:
+ self.api.feature_set(name, value)
+ except vdebug.dbgp.DBGPError as e:
+ error_str = "Failed to set feature %s: %s" %(name,str(e.args[0]))
+ self.ui.error(error_str)
+
def refresh(self,status):
"""The main action performed after a deubugger step.
View
@@ -90,6 +90,8 @@ let g:vdebug_options_defaults = {
\ "continuous_mode" : 0
\}
+let g:vdebug_features = {}
+
" Different symbols for non unicode Vims
if g:vdebug_force_ascii == 1
let g:vdebug_options_defaults["marker_default"] = '*'

0 comments on commit 8f24e5c

Please sign in to comment.