fix: cmp slash commands disappeared (#869)

This commit is contained in:
yetone
2024-11-19 06:01:50 +08:00
committed by GitHub
parent cf2312abbc
commit c551bbe5b6
3 changed files with 27 additions and 37 deletions

View File

@@ -1,3 +1,5 @@
local api = vim.api
---@class mentions_source
---@field mentions {description: string, command: AvanteMentions, details: string, shorthelp?: string, callback?: AvanteMentionCallback}[]
---@field bufnr integer
@@ -13,7 +15,7 @@ function mentions_source.new(mentions, bufnr)
}, { __index = mentions_source })
end
function mentions_source:is_available() return vim.api.nvim_get_current_buf() == self.bufnr end
function mentions_source:is_available() return api.nvim_get_current_buf() == self.bufnr end
mentions_source.get_position_encoding_kind = function() return "utf-8" end