mirror of
https://github.com/neovim/neovim.git
synced 2024-12-19 02:34:59 -07:00
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 ba8f19ebb6
, 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
This commit is contained in:
parent
c0fa721ade
commit
4d0f4c3de9
@ -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(
|
||||
|
Loading…
Reference in New Issue
Block a user