brackets-code-folding
brackets-code-folding copied to clipboard
beautify extension colapse compacted blocks when is called
test scenario
- item
- item
then collapse the ol element; after that, try to use ALT + CTRL + L (beautify command)
you'll notice that the colapsed blocks will get expanded.
This is an interesting problem - and I would be happy for any suggestions on any elegant ways to fix it. As far as I can tell, beautifying a document sometimes changes the line numbers of statements in the file. So a folded statement may be moved to a new line when beautified. This means we cannot simply cache the line folds before formatting and then restore them after formatting.
One workaround is to format a subset of the document by selecting a code region before formatting.