This commit is contained in:
hrsh7th
2021-08-16 14:02:09 +09:00
parent 141187561c
commit e4deb0142a
5 changed files with 41 additions and 22 deletions

View File

@@ -133,11 +133,11 @@ source.get_default_insert_range = function(self)
return {
start = {
line = self.context.cursor.row - 1,
character = vim.str_utfindex(self.context.cursor_line, self.offset - 1),
character = misc.to_utfindex(self.context.cursor_line, self.offset),
},
['end'] = {
line = self.context.cursor.row - 1,
character = vim.str_utfindex(self.context.cursor_line, self.context.cursor.col - 1),
character = misc.to_utfindex(self.context.cursor_line, self.context.cursor.col),
},
}
end)
@@ -155,11 +155,11 @@ source.get_default_replace_range = function(self)
return {
start = {
line = self.context.cursor.row - 1,
character = vim.str_utfindex(self.context.cursor_line, self.offset - 1),
character = misc.to_utfindex(self.context.cursor_line, self.offset),
},
['end'] = {
line = self.context.cursor.row - 1,
character = vim.str_utfindex(self.context.cursor_line, e and self.offset + e - 2 or self.context.cursor.col - 1),
character = misc.to_utfindex(self.context.cursor_line, e and self.offset + e - 1 or self.context.cursor.col),
},
}
end)