Skip to content

Commit

Permalink
Fix issue with end out of range error
Browse files Browse the repository at this point in the history
  • Loading branch information
hurstindustries authored Nov 14, 2022
1 parent b5ecd82 commit b3319b5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/range.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module.exports.sliceRange = (lines, startCol, endCol, inclusive = false) => {
if (startCol >= lines[mid].endCol) {
start = mid + 1
} else if (endCol < lines[mid].startCol) {
end = mid - 1
end = Math.max(mid - 1, start);
} else {
end = mid
while (mid >= 0 && startCol < lines[mid].endCol && endCol >= lines[mid].startCol) {
Expand Down

0 comments on commit b3319b5

Please sign in to comment.