Sublime Forum

Bugs with folding

#1

1
Functions with one line isn’t possible to fold in javacsript/coffeescript.
EDIT: Except when folding globally, like Ctrl+k, Ctrl+1.

Example:

[code]foo = function () {
bar();
}

foo = ->
bar()
[/code]

2
Code folds differently depending on if a empty line exists under the function.

Example:

foo -> bar() baz()
folds to

foo -> ... )

but

foo -> bar() baz() (empty line)
folds to

foo -> ...

3
Code folds differently depending on indentation style. The banner style (https://en.wikipedia.org/wiki/Indent_style#Banner_style) for example, behaves really weird.

Example:

foo(function () { bar(); baz(); });
folds to

foo(function () ... ;

4
Not really a bug, but since folding isn’t undoable, some confusion can occur when ctrl+z changes something inside some folded code which the used can’t see.

1 Like