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

Indentation breaks code folding #3891

Closed
westy92 opened this issue Mar 9, 2016 · 1 comment
Closed

Indentation breaks code folding #3891

westy92 opened this issue Mar 9, 2016 · 1 comment
Assignees

Comments

@westy92
Copy link

westy92 commented Mar 9, 2016

I am using the latest version on Windows 7 Pro x64.
image

This may be by design, but a single-line code block cannot be collapsed.
image

However, changing the indentation "allows" it.
image

But when I try to collapse it, it does this:
image

If I remove the single-line code block, things look as expected:
image

Changing the indentation proves problematic, allowing me to collapse from the end brace:
image

Doing the collapse:
image

I'm not sure if the language matters, but this is in a PHP file.

@aeschli
Copy link
Contributor

aeschli commented Mar 9, 2016

What's currently implemented is a indentation based folding strategy. It purely looks at the indentation of the lines. When a line is followed by one or more line that have more indentation, then this is a foldable region. Empty lines are ignored.
If you look at your screenshot, you see that strategy applied.

The next step will be to make folding strategy customizable, e.g. per language, to e.g. use brackets as beginning and end of a region. #3422 is the issue for that.

@aeschli aeschli closed this as completed Mar 9, 2016
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants