Skip to content

Commit

Permalink
Don't sort in Doc:get_selection_idx with an invalid index
Browse files Browse the repository at this point in the history
  • Loading branch information
Guldoman committed Nov 2, 2022
1 parent 9951e78 commit b029f59
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion data/core/doc/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ end
---@return integer,integer,integer,integer,boolean? @line1, col1, line2, col2, was the selection sorted
function Doc:get_selection_idx(idx, sort)
local line1, col1, line2, col2 = self.selections[idx*4-3], self.selections[idx*4-2], self.selections[idx*4-1], self.selections[idx*4]
if sort then
if line1 and sort then
return sort_positions(line1, col1, line2, col2)
else
return line1, col1, line2, col2
Expand Down

0 comments on commit b029f59

Please sign in to comment.