Merge pull request #390 from adamharrison/cursor-fixes

Fixed multilne cursors at the edges of docuemnts.
This commit is contained in:
Adam 2021-08-14 09:12:13 -04:00 committed by GitHub
commit 9e45b1de58
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -74,7 +74,7 @@ end
local function split_cursor(direction)
local new_cursors = {}
for _, line1, col1 in doc():get_selections() do
if line1 > 1 and line1 < #doc().lines then
if line1 + direction >= 1 and line1 + direction <= #doc().lines then
table.insert(new_cursors, { line1 + direction, col1 })
end
end