From 210091e839b428ec539c24cec4813fc9366afa7f Mon Sep 17 00:00:00 2001 From: Dimitris Dimitropoulos Date: Sun, 10 Nov 2024 12:33:39 +0200 Subject: fix(texlab): use exec_cmd method (#3427) Problem: vim.lsp.buf.execute_command has been deprecated in nightly Solution: add version check of nvim and use client:exec_command for nightly version --------- Co-authored-by: glepnir --- lua/lspconfig/configs/texlab.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'lua') diff --git a/lua/lspconfig/configs/texlab.lua b/lua/lspconfig/configs/texlab.lua index c1a57579..ecbf0a9a 100644 --- a/lua/lspconfig/configs/texlab.lua +++ b/lua/lspconfig/configs/texlab.lua @@ -52,9 +52,16 @@ end local function buf_cancel_build() local bufnr = vim.api.nvim_get_current_buf() - if not util.get_active_client_by_name(bufnr, 'texlab') then + local client = util.get_active_client_by_name(bufnr, 'texlab') + if not client then return vim.notify('Texlab client not found', vim.log.levels.ERROR) end + if vim.fn.has 'nvim-0.11' == 1 then + return client:exec_cmd({ + title = 'cancel', + command = 'texlab.cancelBuild', + }, { bufnr = bufnr }) + end vim.lsp.buf.execute_command { command = 'texlab.cancelBuild' } vim.notify('Build cancelled', vim.log.levels.INFO) end -- cgit v1.2.3-70-g09d2