aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/lsp/util.lua
diff options
context:
space:
mode:
authorRaphael <glepnir@neovim.pro>2023-07-25 19:38:48 +0800
committerGitHub <noreply@github.com>2023-07-25 04:38:48 -0700
commit4d0f4c3de9cbdcf85e606b5aaf9488820b95b679 (patch)
tree2a285d37c25fb0a45ed4823df99c2c435637454b /runtime/lua/vim/lsp/util.lua
parentc0fa721adeabf1d93ad71e598782b52c43d8e8f7 (diff)
downloadrneovim-4d0f4c3de9cbdcf85e606b5aaf9488820b95b679.tar.gz
rneovim-4d0f4c3de9cbdcf85e606b5aaf9488820b95b679.tar.bz2
rneovim-4d0f4c3de9cbdcf85e606b5aaf9488820b95b679.zip
fix(lsp): E403 if doc contains multiple codeblocks #24458
Problem: Content that has codeblocks with different languages, results in multiple calls to: syntax include vim syntax/vim.vim which raises error: E403: syntax sync: line continuations pattern specified twice Before ba8f19ebb67ca27d746f4b1cd902ab3d807eace3, this was avoided by using pcall() to ignore the error. Solution: Restore the use of pcall() to ignore the error. We plan to replace this logic with a treesitter approach, so this is good enough for now. Fix #24431
Diffstat (limited to 'runtime/lua/vim/lsp/util.lua')
-rw-r--r--runtime/lua/vim/lsp/util.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/runtime/lua/vim/lsp/util.lua b/runtime/lua/vim/lsp/util.lua
index 4ff420cf48..4d3071fd68 100644
--- a/runtime/lua/vim/lsp/util.lua
+++ b/runtime/lua/vim/lsp/util.lua
@@ -1466,7 +1466,7 @@ function M.stylize_markdown(bufnr, contents, opts)
if #api.nvim_get_runtime_file(('syntax/%s.vim'):format(ft), true) == 0 then
return
end
- vim.cmd(string.format('syntax include %s syntax/%s.vim', lang, ft))
+ pcall(vim.cmd, string.format('syntax include %s syntax/%s.vim', lang, ft))
langs[lang] = true
end
vim.cmd(