thehogfather / brackets-code-folding

Code folding extension for brackets IDE
134 stars 42 forks source link

Code folding leaves some code at the top. #43

Closed ishan1608 closed 10 years ago

ishan1608 commented 10 years ago

When folding the code, the arrow is positioned in wrong location, and thus does not folds the entire code, it leaves some code at the top. I believe this may be occurring because the extension must be folding from the line where opening brace ' { ' is placed and not from where the code actually starts.

To reproduce go to brackets>src>editor>ImageViewer.js:265 click on the code folding icon or use the shortcut to fold the ' if ' statement. Screenshots : code-folding-wrong-position first-line left

cortex359 commented 10 years ago

This behavior is intended and common around code editors. When you fold code that is executed under a certain condition it seems very practical to see the condition. You fold the code according to its logic... Same goes for the variables, the name isn't folded, just the values.

thehogfather commented 10 years ago

The folding logic for .js files works by finding ranges of the contents within braces. Hence it has a lot to do with the format of the code.

I am closing this issue.