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/xml-fold.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/public/vendor/codemirror/addon/fold/xml-fold.js b/public/vendor/codemirror/addon/fold/xml-fold.js
index f8c67b89..75a9e305 100644
--- a/public/vendor/codemirror/addon/fold/xml-fold.js
+++ b/public/vendor/codemirror/addon/fold/xml-fold.js
@@ -21,8 +21,8 @@
function Iter(cm, line, ch, range) {
this.line = line; this.ch = ch;
this.cm = cm; this.text = cm.getLine(line);
- this.min = range ? range.from : cm.firstLine();
- this.max = range ? range.to - 1 : cm.lastLine();
+ this.min = range ? Math.max(range.from, cm.firstLine()) : cm.firstLine();
+ this.max = range ? Math.min(range.to - 1, cm.lastLine()) : cm.lastLine();
}
function tagAt(iter, ch) {