Improve regex handling

This commit is contained in:
hrsh7th
2021-11-09 17:07:13 +09:00
parent c7a1b9f7c0
commit a62375e4cf
2 changed files with 15 additions and 18 deletions

View File

@@ -68,7 +68,7 @@ end
---@return number|nil
context.get_offset = function(self, keyword_pattern)
return self.cache:ensure({ 'get_offset', keyword_pattern, self.cursor_before_line }, function()
return pattern.offset(keyword_pattern .. '$', self.cursor_before_line) or self.cursor.col
return pattern.offset(keyword_pattern .. '\\m$', self.cursor_before_line) or self.cursor.col
end)
end