Question

Is there any way to get line numbers of all lines in editor with "triangle" button (for folding/unfolding) in gutter, no matter if they are already folded or not?

Was it helpful?

Solution

See foldAll function. Since Ace recomputes fold data lazily, so you can go over all lines and do

var foldWidgets = editor.session.foldWidgets
var fw = foldWidgets[row]; // use cached value
if (fw == null) // if it's not there recompute it
    fw = editor.session.getFoldWidget(row);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top