Hi,

Just in case it's useful I've a patch to make "j" and "k" navigation work in 
the "Variables", "Stack" and "Breakpoints" windows. My vim muscle memory tries 
to go <up> and <down> with j and k in those windows.

I've never created a GIT patch before so not sure if it's correct. No worries 
if patch not suitable for inclusion.

I've just started to use "Pudb" this week and it brings back lots of memories - 
I used to program Turbo Pascal back in 1993(!)
Many thanks for a great debugger.

best regards,
Enda
ps: I created the patch against 407b491db51bc0c20a2f4ba57f7d3e09bf7a921a in 
"master"
>From ca7a7f8be0af4fb39c9cead119f758c9af56a7a0 Mon Sep 17 00:00:00 2001
From: ef <[email protected]>
Date: Wed, 5 Feb 2014 15:59:01 +0000
Subject: [PATCH] add "j" and "k" keys to Variable/Stack/Breakpoint windows

---
 pudb/debugger.py |   17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/pudb/debugger.py b/pudb/debugger.py
index 1f478d6..69f5102 100644
--- a/pudb/debugger.py
+++ b/pudb/debugger.py
@@ -803,6 +803,12 @@ class DebuggerUI(FrameVarInfoKeeper):
 
             self.update_var_view()
 
+        def move_down(w, size, key):
+            w.keypress(size, "down")
+
+        def move_up(w, size, key):
+            w.keypress(size, "up")
+
         def insert_watch(w, size, key):
             watch_edit = urwid.Edit([
                 ("label", "Watch expression: ")
@@ -823,6 +829,8 @@ class DebuggerUI(FrameVarInfoKeeper):
                 fvi.watches.append(we)
                 self.update_var_view()
 
+        self.var_list.listen("j", move_down)
+        self.var_list.listen("k", move_up)
         self.var_list.listen("\\", change_var_state)
         self.var_list.listen("t", change_var_state)
         self.var_list.listen("r", change_var_state)
@@ -857,6 +865,8 @@ class DebuggerUI(FrameVarInfoKeeper):
         def move_stack_down(w, size, key):
             self.debugger.move_down_frame()
 
+        self.stack_list.listen("j", move_down)
+        self.stack_list.listen("k", move_up)
         self.stack_list.listen("H", move_stack_top)
         self.stack_list.listen("u", move_stack_up)
         self.stack_list.listen("d", move_stack_down)
@@ -964,6 +974,8 @@ class DebuggerUI(FrameVarInfoKeeper):
                 else:
                     self.update_breakpoints()
 
+        self.bp_list.listen("j", move_down)
+        self.bp_list.listen("k", move_up)
         self.bp_list.listen("enter", examine_breakpoint)
         self.bp_list.listen("d", delete_breakpoint)
         self.bp_list.listen("s", save_breakpoints)
@@ -1067,11 +1079,6 @@ class DebuggerUI(FrameVarInfoKeeper):
                 lineno = min(max(0, int(lineno_edit.value())-1), len(self.source)-1)
                 self.source.set_focus(lineno)
 
-        def move_down(w, size, key):
-            w.keypress(size, "down")
-
-        def move_up(w, size, key):
-            w.keypress(size, "up")
 
         def page_down(w, size, key):
             w.keypress(size, "page down")
-- 
1.7.10.4

_______________________________________________
Pudb mailing list
[email protected]
http://lists.tiker.net/listinfo/pudb

Reply via email to