diff --git a/lua/copilot/api.lua b/lua/copilot/api.lua index b996fe4e..3c27f1e7 100644 --- a/lua/copilot/api.lua +++ b/lua/copilot/api.lua @@ -28,7 +28,12 @@ end ---@return boolean sent function mod.notify(client, method, params) logger.trace("api notify:", method, params) - return client.notify(method, params) + + if vim.fn.has("nvim-0.11") == 1 then + return client:notify(method, params) + else + return client.notify(method, params) + end end ---@alias copilot_editor_info { name: string, version: string } diff --git a/lua/copilot/panel.lua b/lua/copilot/panel.lua index 085548c4..fc6f7537 100644 --- a/lua/copilot/panel.lua +++ b/lua/copilot/panel.lua @@ -469,7 +469,7 @@ function panel:refresh() else local utf16_index -- assume cursor at end of line - if vim.has("nvim-0.11") then + if vim.fn.has("nvim-0.11") == 1 then utf16_index = vim.str_utfindex(self.state.line, "utf-16") else ---@diagnostic disable-next-line: missing-parameter