Don't sort in Doc:get_selection_idx with an invalid index
This commit is contained in:
@@ -168,7 +168,7 @@ end
|
|||||||
---@return integer,integer,integer,integer,boolean? @line1, col1, line2, col2, was the selection sorted
|
---@return integer,integer,integer,integer,boolean? @line1, col1, line2, col2, was the selection sorted
|
||||||
function Doc:get_selection_idx(idx, sort)
|
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]
|
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)
|
return sort_positions(line1, col1, line2, col2)
|
||||||
else
|
else
|
||||||
return line1, col1, line2, col2
|
return line1, col1, line2, col2
|
||||||
|
|||||||
Reference in New Issue
Block a user