-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add 'C' and 'E' commands to deeply collapse/expand nodes.
Also update the focus behavior of c/e/C/E so that the focused node stays in the same position on the screen. This is an improvement over the previous behavior (and roughly matches the same behavior that would occur when you pressed 'm' to toggle between data and line mode), but there are still some wonky cases such as: - Behavior when the top of the file is visible - Behavior when you're focusing the closing of a container in line mode (maybe the opening of the container, if it's visible, should stay in the same place?) It seems desirable that the viewport would be remain unchanged after pressing 'c' and then 'e' (or vice versa), assuming the collapsed state of everything is unchanged, but that might be impossible in the general case. Maybe there should be slightly different behavior for expanding vs collapsing too? I also left a TODO noting that it would be good to unify/classify the desired viewport behavior after an operation, rather than using a couple of very ill-defined boolean functions right now. Possibly values include: - ViewportUpdatedByAction (the code for the action manages updating the viewport by itself, like for zz commands) - ScrollToEnsureFocusedRowIsVisible (the action changes the focused row, and the viewport should scroll to get it into view) - KeepFocusedLineInSamePlaceOnScreen (the focused line should be in the same place on the screen after this) The third one could be generalizable to keeping an arbitrary row (not necessarily the focused one) in the same place, or put it in the same spot +/- some delta.
- Loading branch information
1 parent
275f9cb
commit 5d5a597
Showing
4 changed files
with
191 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters