Search code examples
codemirroradobe-brackets

Character based folding in CodeMirror?


How can i make the folding custom in CodeMirror;

I try to make an extension that allows me to add a folding to templates where it begins with {% and ends with {% end for Brackets editor.

But in Codemirror only allows some kind of folding.


Solution

  • You'll have to write your own range-finding function. See the various ones that exist in addon/fold. comment-fold.js is probably the simplest.