Programmatically fold code in ACE editor

oberstet picture oberstet · Oct 10, 2012 · Viewed 8.2k times · Source

ACE (Bespin successsor) features code folding. Also, there is an event changeFold which fires upon code being folded or unfolded.

How do I trigger/set code folding from JavaScript?

I.e. fold up code for function beginning at line N.