Fix full line cut when only a single line remains

This commit is contained in:
Guldoman 2022-06-24 05:49:20 +02:00
parent 6a8eed45c7
commit 9cd47aa12e
No known key found for this signature in database
GPG Key ID: EA928C8BDA1A8825
1 changed files with 2 additions and 0 deletions

View File

@ -65,6 +65,8 @@ local function cut_or_copy(delete)
if delete then
if line1 < #doc().lines then
doc():remove(line1, 1, line1 + 1, 1)
elseif #doc().lines == 1 then
doc():remove(line1, 1, line1, math.huge)
else
doc():remove(line1 - 1, math.huge, line1, math.huge)
end