I would like to use Codemirror codefolding to fold just {
and }
as well as comments. The only problem I am having is it also codefolds the brackets [
and ]
. The square brackets are almost always part of one line statements and I do not wish to use codefolding for them. How can I prevent that?
In codemirror/addon/fold/brace-fold.js
I tried commenting out these lines:
if (startCh == null) {
startToken = "[", endToken = "]";
startCh = findOpening("[");
}
but that still does not prevent codefolding for square brackets. Also, any ideas what addon/fold/indent-fold.js
does? I am not sure whether I should include that file.
N.B. I am using Codefolding for both JavaScript and PHP modes.
EDIT
Here's a demonstration of Codemirror codefolding.