From 90bfcd4d2ea8b03887975da798915638162f13cb Mon Sep 17 00:00:00 2001 From: Rusty Wagner Date: Mon, 22 Aug 2016 23:50:16 -0400 Subject: Allow setting here or current_address to navigate in the current view --- python/__init__.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'python') 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 -- cgit v1.3.1