Skip to content

Commit

Permalink
range should never exceed document
Browse files Browse the repository at this point in the history
fixes #1202
  • Loading branch information
jhchen committed Dec 23, 2016
1 parent 154f2b4 commit 9d6d37b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions core/selection.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ class Selection {
}
});
let start = Math.min(...indexes), end = Math.max(...indexes);
end = Math.min(end, this.scroll.length() - 1);
return [new Range(start, end-start), range];
}

Expand Down

0 comments on commit 9d6d37b

Please sign in to comment.