Skip to content

Conversation

@ssigwart
Copy link
Contributor

This adds 3 keyboard shortcuts to jump between folds.

  • Current line to parent fold (Ctrl-F, P). "P" for parent.
  • Current line to previous fold at the same level. (Ctrl-F, Up)
  • Current line to next fold at the same level. (Ctrl-F, Down)

By restricting the previous and next folds to the current level. It makes it easy to navigate the different cases of if/else statements.

This PR fixes #91023.

I updated the unit test for this. You can also test by opening a file with folds and try out the keyboard shortcuts.

- Current line to parent fold.
- Current line to previous fold at the same level.
- Current line to next fold at the same level.
@ghost
Copy link

ghost commented Jul 12, 2021

CLA assistant check
All CLA requirements met.

@aeschli
Copy link
Contributor

aeschli commented Jul 12, 2021

Thanks for the great PR!

Only concert is the shortcut which is uncommon and collides with existing usages on the Mac.

@aeschli aeschli added this to the July 2021 milestone Jul 12, 2021
@ssigwart
Copy link
Contributor Author

Thanks for reviewing this so quickly, @aeschli. I removed the shortcut. Please let me know if you have other ideas for what the shortcut should be.

@aeschli aeschli added editor-folding Editor code folding issues feature-request Request for new features or functionality labels Jul 19, 2021
@aeschli aeschli merged commit 1df15a1 into microsoft:main Jul 19, 2021
@aeschli
Copy link
Contributor

aeschli commented Jul 19, 2021

Thanks a lot @ssigwart !

@aeschli
Copy link
Contributor

aeschli commented Jul 19, 2021

I've released the PR without shortcuts for now. Happy to add some, if we get non-conflicting ones.

@ssigwart
Copy link
Contributor Author

Thanks for merging it, @aeschli. I notice a few checks failed saying they were cancelled. Do I need to do anything with them?

@ssigwart ssigwart deleted the folding branch July 20, 2021 02:02
@aeschli
Copy link
Contributor

aeschli commented Jul 20, 2021

I think this is because I merged without waiting for the last CI build to complete. But all tests pass, nothing anymore to do.

@aeschli
Copy link
Contributor

aeschli commented Jul 20, 2021

For consistency I'll rename the command from 'Jump' to 'Go to`

@ssigwart
Copy link
Contributor Author

Thanks, @aeschli. That makes sense.

@github-actions github-actions bot locked and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

editor-folding Editor code folding issues feature-request Request for new features or functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[folding] Command to jump to previous/next fold

2 participants