Skip to content

Commit

Permalink
[xml-fold addon] Clip iterator range to editor range
Browse files Browse the repository at this point in the history
Closes #4018
  • Loading branch information
marijnh committed Sep 15, 2016
1 parent 3d89b71 commit 7db967f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions addon/fold/xml-fold.js
Expand Up @@ -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) {
Expand Down

0 comments on commit 7db967f

Please sign in to comment.