From df0f6fb94cb0efae95b9a5c03e35abdc14951ef8 Mon Sep 17 00:00:00 2001 From: takase1121 <20792268+takase1121@users.noreply.github.com> Date: Sun, 2 Jan 2022 19:18:08 +0800 Subject: [PATCH] make set_selections consistent --- data/core/commands/doc.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/data/core/commands/doc.lua b/data/core/commands/doc.lua index 0b040d88..6337ae89 100644 --- a/data/core/commands/doc.lua +++ b/data/core/commands/doc.lua @@ -337,8 +337,7 @@ local commands = { col2 = col2 + (line1 == line2 and (#comment[1] + 1) or 0) doc():insert(line2, col2, " " .. comment[2]) - col2 = col2 + #comment[2] + 1 - doc():set_selections(idx, line1, col1, line2, col2) + doc():set_selections(idx, line1, col1, line2, col2 + #comment[2] + 1) end end end,