summaryrefslogtreecommitdiff
path: root/public/vendor/codemirror/addon/fold
diff options
context:
space:
mode:
Diffstat (limited to 'public/vendor/codemirror/addon/fold')
-rw-r--r--public/vendor/codemirror/addon/fold/comment-fold.js2
-rw-r--r--public/vendor/codemirror/addon/fold/foldcode.js5
-rw-r--r--public/vendor/codemirror/addon/fold/foldgutter.js2
3 files changed, 5 insertions, 4 deletions
diff --git a/public/vendor/codemirror/addon/fold/comment-fold.js b/public/vendor/codemirror/addon/fold/comment-fold.js
index 60fa3e43..e8d800eb 100644
--- a/public/vendor/codemirror/addon/fold/comment-fold.js
+++ b/public/vendor/codemirror/addon/fold/comment-fold.js
@@ -29,7 +29,7 @@ CodeMirror.registerGlobalHelper("fold", "comment", function(mode) {
}
if (pass == 1 && found < start.ch) return;
if (/comment/.test(cm.getTokenTypeAt(CodeMirror.Pos(line, found + 1))) &&
- (lineText.slice(found - endToken.length, found) == endToken ||
+ (found == 0 || lineText.slice(found - endToken.length, found) == endToken ||
!/comment/.test(cm.getTokenTypeAt(CodeMirror.Pos(line, found))))) {
startCh = found + startToken.length;
break;
diff --git a/public/vendor/codemirror/addon/fold/foldcode.js b/public/vendor/codemirror/addon/fold/foldcode.js
index 62911f93..78b36c46 100644
--- a/public/vendor/codemirror/addon/fold/foldcode.js
+++ b/public/vendor/codemirror/addon/fold/foldcode.js
@@ -49,7 +49,7 @@
});
var myRange = cm.markText(range.from, range.to, {
replacedWith: myWidget,
- clearOnEnter: true,
+ clearOnEnter: getOption(cm, options, "clearOnEnter"),
__isFold: true
});
myRange.on("clear", function(from, to) {
@@ -129,7 +129,8 @@
rangeFinder: CodeMirror.fold.auto,
widget: "\u2194",
minFoldSize: 0,
- scanUp: false
+ scanUp: false,
+ clearOnEnter: true
};
CodeMirror.defineOption("foldOptions", null);
diff --git a/public/vendor/codemirror/addon/fold/foldgutter.js b/public/vendor/codemirror/addon/fold/foldgutter.js
index f101e267..9d323265 100644
--- a/public/vendor/codemirror/addon/fold/foldgutter.js
+++ b/public/vendor/codemirror/addon/fold/foldgutter.js
@@ -50,7 +50,7 @@
}
function isFolded(cm, line) {
- var marks = cm.findMarksAt(Pos(line));
+ var marks = cm.findMarks(Pos(line, 0), Pos(line + 1, 0));
for (var i = 0; i < marks.length; ++i)
if (marks[i].__isFold && marks[i].find().from.line == line) return marks[i];
}