inducer / pudb

Full-screen console debugger for Python
https://documen.tician.de/pudb/
Other
3k stars 230 forks source link

Add support for scrolling sidebar panes with j/k #328

Closed craftyguy closed 5 years ago

craftyguy commented 5 years ago

This adds support for scrolling the variable, stack, and breakpoint panes with the 'j' and 'k' keys. This functionality is disabled by default, and can be enabled with a new config option in the config dialog.

craftyguy commented 5 years ago

I could see great possibility in using something similar to this patch for adding/overriding any number of key bindings in the application, so I tried to keep that possibility in mind when writing this.

I'm very new to the pudb codebase (first look was last night) , so if there's a better way to implement this and/or some refactoring of this patch is needed, let me know!

craftyguy commented 5 years ago

I guess another way to write this patch is to get rid of the SignalWrap methods I added and use rhsscroll{up,down} to decide whether or not to send the key up/down events based on the config option.. but this would leave the signal wired up for listening to 'j' and 'k' at all times (even if the scroll option was 'disabled')

inducer commented 5 years ago

but this would leave the signal wired up for listening to 'j' and 'k' at all times (even if the scroll option was 'disabled')

Fine by me (and totally worth it for the simpler logic, iMO).

craftyguy commented 5 years ago

@inducer Thanks for the feedback! I have modified this MR to use the simpler behavior, and handle the application of the config in the up/down methods