Skip to content Skip to sidebar Skip to footer

CodeMirror FoldCode Method Not Working

I am trying to write an online editor and at the moment am trying to implement code folding. On the CodeMirror website they do a demo that uses the foldCode command that comes from

Solution 1:

You don't seem to be loading any actual folding functions. For JavaScript, you probably want addon/fold/brace-fold.js.


Solution 2:

Besides the other answers, add

editor.foldCode(CodeMirror.Pos(0, 0));

outside of your var editor


Solution 3:

change

foldgutter: true;

to

foldGutter: true;

Post a Comment for "CodeMirror FoldCode Method Not Working"