feat(TreeEditor): add keyboard support - arrow key move / expand#74
Open
John-Paul-R wants to merge 7 commits into
Open
feat(TreeEditor): add keyboard support - arrow key move / expand#74John-Paul-R wants to merge 7 commits into
John-Paul-R wants to merge 7 commits into
Conversation
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hello, and happy Modtoberfest!
This PR adds the ability to navigate the
TreeEditorwith via keyboardUp,Down,Left,RightorHJKL(vim keys).I tried to mirror vscode's file tree navigation behavior pretty closely since, well, we're in vscode. (and I think vscode's behavior here is reasonable). A known exception in this current iteration is that
Downwhen on the last item in a container doesn't take you to the item after the container. (andDownwhen on the root item of a container takes you to that container's sibling, rather than entering the container (Rightis used for that)). This might be worth changing, but I'm fairly happy with where this is at right now.I tried not to restructure things too much, so I computed most of the "next item" fun on the fly, rather than modifying the core tree data structure to support it. (A new structure, or added cache, at least, might be helpful on super big objects, but I think this will be more than fast enough for the vast majority of files.)
Demo!
2024-10-12_14-32-19.c.mp4