diff options
| author | Dimitris Dimitropoulos <dimitris.dimitropoulos00@gmail.com> | 2024-11-10 12:33:39 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-11-10 18:33:39 +0800 |
| commit | 210091e839b428ec539c24cec4813fc9366afa7f (patch) | |
| tree | 2f0af0528b85dcc51df4c46eca2a83eca167ec14 /lua | |
| parent | docs: update configs.md (diff) | |
| download | nvim-lspconfig-210091e839b428ec539c24cec4813fc9366afa7f.tar nvim-lspconfig-210091e839b428ec539c24cec4813fc9366afa7f.tar.gz nvim-lspconfig-210091e839b428ec539c24cec4813fc9366afa7f.tar.bz2 nvim-lspconfig-210091e839b428ec539c24cec4813fc9366afa7f.tar.lz nvim-lspconfig-210091e839b428ec539c24cec4813fc9366afa7f.tar.xz nvim-lspconfig-210091e839b428ec539c24cec4813fc9366afa7f.tar.zst nvim-lspconfig-210091e839b428ec539c24cec4813fc9366afa7f.zip | |
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 <glephunter@gmail.com>
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/lspconfig/configs/texlab.lua | 9 |
1 files changed, 8 insertions, 1 deletions
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 |
