summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRusty Wagner <rusty@vector35.com>2016-08-22 23:50:16 -0400
committerRusty Wagner <rusty@vector35.com>2016-08-22 23:50:31 -0400
commit90bfcd4d2ea8b03887975da798915638162f13cb (patch)
tree98c7dd9ff6e25160978b44d187f01933da745a32
parent923b0b1aa9df85844c6002e1ffbbea3ba47e2b04 (diff)
Allow setting here or current_address to navigate in the current view
-rw-r--r--python/__init__.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/python/__init__.py b/python/__init__.py
index 69858d2e..027c2a1f 100644
--- a/python/__init__.py
+++ b/python/__init__.py
@@ -9476,6 +9476,15 @@ class PythonScriptingInstance(ScriptingInstance):
self.locals["current_selection"] = (self.active_selection_begin, self.active_selection_end)
self.interpreter.runsource(code)
+
+ if self.locals["here"] != self.active_addr:
+ if not self.active_view.file.navigate(self.active_view.file.view, self.locals["here"]):
+ sys.stderr.write("Address 0x%x is not valid for the current view\n" % self.locals["here"])
+ elif self.locals["current_address"] != self.active_addr:
+ if not self.active_view.file.navigate(self.active_view.file.view, self.locals["current_address"]):
+ sys.stderr.write("Address 0x%x is not valid for the current view\n" % self.locals["current_address"])
+ except:
+ traceback.print_exc()
finally:
PythonScriptingInstance._interpreter.value = None
self.instance.input_ready_state = core.ReadyForScriptExecution