Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[folding] provide non-selection aware fold level command #55252

Open
goulashsoup opened this issue Jul 27, 2018 · 5 comments · May be fixed by #117991
Open

[folding] provide non-selection aware fold level command #55252

goulashsoup opened this issue Jul 27, 2018 · 5 comments · May be fixed by #117991
Assignees
Labels
editor-folding Editor code folding issues feature-request Request for new features or functionality
Milestone

Comments

@goulashsoup
Copy link

  • VSCode Version:
    vscode version
  • OS Version:
    Win 10 64 bit

Steps to Reproduce:

  1. Open a file which has different folding levels through indentation
  2. Move the cursor to a specific level x
  3. Run command 'Fold level x'

All areas of that level getting folded but not the one the curor is currently in.

vs-code-issues

Does this issue occur when all extensions are disabled?: Yes

@vscodebot
Copy link

vscodebot bot commented Jul 27, 2018

(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

@vscodebot vscodebot bot added editor editor-folding Editor code folding issues labels Jul 27, 2018
@GammaGames
Copy link

Ctrl+K Ctrl+[num] is the shortcut for folding all regions at a level, this is documented behavior.

  • Fold Level X (Ctrl+K Ctrl+2 for level 2) folds all regions of level X, except the region at the current cursor position.

(from https://code.visualstudio.com/docs/editor/codebasics#_folding)

@goulashsoup
Copy link
Author

goulashsoup commented Jul 27, 2018

Aha, might turn that into a feature request. Nevertheless documented or not i would still let it count as a form of misleading command name, it's Fold level x not Fold level x BUT ignore cursor level...

@aeschli aeschli changed the title When folding, area of cursor does not get folded [folding] provide non-selection aware fold level command Jul 30, 2018
@aeschli aeschli added this to the Backlog milestone Jul 30, 2018
@aeschli aeschli added the feature-request Request for new features or functionality label Sep 24, 2018
@waynebloss
Copy link

I was just researching to submit this as a feature request. It's always bothered me because many times it seems like the fold command doesn't work at all until you realize that your cursor position is preventing it from folding.

I would go further and ask for this setting to default to ON because it's sufficiently confusing enough when folding doesn't work due to cursor position and I've seen it happen almost every time I instruct a junior programmer to try out folding.

@NotWearingPants
Copy link
Contributor

How about editor.foldLevelCommandsKeepSelectionVisible: boolean, "Controls whether folding a specific level will avoid folding the cursor or selection."?

NotWearingPants added a commit to NotWearingPants/vscode that referenced this issue Mar 2, 2021
NotWearingPants added a commit to NotWearingPants/vscode that referenced this issue Mar 3, 2021
This reverts commit 6c7218c.
NotWearingPants added a commit to NotWearingPants/vscode that referenced this issue Mar 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
editor-folding Editor code folding issues feature-request Request for new features or functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants