brackets-code-folding icon indicating copy to clipboard operation
brackets-code-folding copied to clipboard

beautify extension colapse compacted blocks when is called

Open cmnstmntmn opened this issue 11 years ago • 1 comments

test scenario

  1. item
  2. 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.

cmnstmntmn avatar Nov 05 '13 22:11 cmnstmntmn

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.

thehogfather avatar Nov 06 '13 09:11 thehogfather