From 2475b1624f6becb052f023658f9732490b6c0ea2 Mon Sep 17 00:00:00 2001 From: Adam Harrison Date: Mon, 7 Jun 2021 08:25:10 -0400 Subject: [PATCH] Fixed error. --- data/core/doc/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/core/doc/init.lua b/data/core/doc/init.lua index 80c8e5de..09816e4d 100644 --- a/data/core/doc/init.lua +++ b/data/core/doc/init.lua @@ -361,7 +361,7 @@ function Doc:replace(fn) if old_text ~= new_text then self:insert(line2, col2, new_text) self:remove(line1, col1, line2, col2) - if had_selection then + if line1 == line2 and col1 == col2 then line2, col2 = self:position_offset(line1, col1, #new_text) self:set_selection(line1, col1, line2, col2) end