aboutsummaryrefslogtreecommitdiff
path: root/data/core/commands
diff options
context:
space:
mode:
authorGuldoman <giulio.lettieri@gmail.com>2022-06-24 05:49:20 +0200
committerGuldoman <giulio.lettieri@gmail.com>2022-06-24 05:49:20 +0200
commit9cd47aa12e1d13eb03f62b86fe822a93f5fee5c4 (patch)
tree1c5aa9d89ddd2bbfb61bd560b95286a78d184ce2 /data/core/commands
parent6a8eed45c7d6ac0ca774415694e44c497ade2bc5 (diff)
downloadlite-xl-9cd47aa12e1d13eb03f62b86fe822a93f5fee5c4.tar.gz
lite-xl-9cd47aa12e1d13eb03f62b86fe822a93f5fee5c4.zip
Fix full line cut when only a single line remains
Diffstat (limited to 'data/core/commands')
-rw-r--r--data/core/commands/doc.lua2
1 files changed, 2 insertions, 0 deletions
diff --git a/data/core/commands/doc.lua b/data/core/commands/doc.lua
index 1b39a9d9..116d48de 100644
--- a/data/core/commands/doc.lua
+++ b/data/core/commands/doc.lua
@@ -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