inducer / pudb

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

Use h/l in the variable to view to collapse/open the current container #396

Closed mvanderkamp closed 4 years ago

mvanderkamp commented 4 years ago

This behaves similarly to, for example, tmux's interactive session/window/pane selection. I did see that h/l were supposed to be mapped to movement in the RHS column already, but this doesn't seem to work for me, and I believe this is a more useful interaction anyway. That said, I'm happy to move it this functionality to a different key.

The benefit is that you can open a huge container, navigate down through it, then when you're done you don't have to scroll all the way back up; just slap 'h'.

asmeurer commented 4 years ago

It seems reasonable to me. Actually h/l scroll in the code view, so I don't think they are supposed to move between panes.

mvanderkamp commented 4 years ago

Ah okay I wasn't sure. I just saw the potential conflict and wanted to bring it up.

mvanderkamp commented 4 years ago

I decided to take it one step further and have each VariableWidget store a reference to its parent. That way we don't have to search through the widget list at all, but can just grab the reference directly. I did go with storing the nesting level as well though, as it does make generating the prefix easier.

Given the changes and fixups, I'm happy to do a rebase if you want.

inducer commented 4 years ago

Given the changes and fixups, I'm happy to do a rebase if you want.

Thanks for offering to do that. I'm not much of a history gardener, so it's not needed from my point of view.

inducer commented 4 years ago

Just played with this a bit, and I like it a lot. I also like how the last iteration of the code came out. Thanks for your contribution!