From 2743dd989e9b932e1b4813a4927d7b84272a14e2 Mon Sep 17 00:00:00 2001 From: hrsh7th <629908+hrsh7th@users.noreply.github.com> Date: Fri, 30 Jun 2023 21:49:25 +0900 Subject: [PATCH] improve pattern handling --- lua/cmp/context.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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