diff --git a/lua/cmp/config/compare.lua b/lua/cmp/config/compare.lua index d361a0568..a920c0160 100644 --- a/lua/cmp/config/compare.lua +++ b/lua/cmp/config/compare.lua @@ -243,8 +243,8 @@ compare.scopes = setmetatable({ }, { ---@type fun(self: table, entry1: cmp.Entry, entry2: cmp.Entry): boolean|nil __call = function(self, entry1, entry2) - local def_depth1 = self.definition_depths[entry1.word] - local def_depth2 = self.definition_depths[entry2.word] + local def_depth1 = self.definition_depths[entry1:get_word()] + local def_depth2 = self.definition_depths[entry2:get_word()] if def_depth1 ~= def_depth2 then if def_depth1 == nil then return false