From bdaddea29ad7e5395358d735756f6e4ec7bbd11b Mon Sep 17 00:00:00 2001 From: Francesco Abbate Date: Wed, 18 Nov 2020 15:48:33 +0100 Subject: [PATCH] Fix behavior when using un-indent command over multiple lines --- data/core/commands/doc.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/data/core/commands/doc.lua b/data/core/commands/doc.lua index a877225..e8eae51 100644 --- a/data/core/commands/doc.lua +++ b/data/core/commands/doc.lua @@ -42,6 +42,10 @@ end local function remove_from_start_of_selected_lines(text, skip_empty) local line1, col1, line2, col2, swap = doc():get_selection(true) + if line2 > line1 and col2 == 1 then + line2 = line2 - 1 + col2 = #doc().lines[line2] + end for line = line1, line2 do local line_text = doc().lines[line] if line_text:sub(1, #text) == text