Fixed error.

This commit is contained in:
Adam Harrison 2021-06-07 08:25:10 -04:00
parent b42708fe56
commit 2475b1624f
1 changed files with 1 additions and 1 deletions

View File

@ -361,7 +361,7 @@ function Doc:replace(fn)
if old_text ~= new_text then if old_text ~= new_text then
self:insert(line2, col2, new_text) self:insert(line2, col2, new_text)
self:remove(line1, col1, line2, col2) 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) line2, col2 = self:position_offset(line1, col1, #new_text)
self:set_selection(line1, col1, line2, col2) self:set_selection(line1, col1, line2, col2)
end end