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 committed Jan 30, 2023
1 parent 04247fd commit 6ff9e2b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/range.js
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 6ff9e2b

Please sign in to comment.