diff --git a/lua/cmp/context.lua b/lua/cmp/context.lua index 0411a54..86c9c29 100644 --- a/lua/cmp/context.lua +++ b/lua/cmp/context.lua @@ -74,7 +74,7 @@ end ---@return integer 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 .. '\\m$', self.cursor_before_line) or self.cursor.col + return pattern.offset([[\%(]] .. keyword_pattern .. [[\)\m$]], self.cursor_before_line) or self.cursor.col end) end