Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- HACK: Workaround https://github.com/neovim/neovim/issues/29550
- if assert(vim.version.range('0.11.3 - 0.11.4')):has(vim.version()) then
- vim.schedule(function()
- local tshighlighter = require('vim.treesitter.highlighter')
- local ns = vim.api.nvim_create_namespace('nvim.treesitter.highlighter')
- vim.api.nvim_set_decoration_provider(ns, {
- --- @diagnostic disable-next-line: invisible, access-invisible
- on_win = tshighlighter._on_win,
- on_line = function(...)
- --- @diagnostic disable-next-line: invisible, access-invisible
- local success, err = pcall(tshighlighter._on_line, ...)
- if not success then
- err = err --[[@as string]]
- if not err:match('out of range') then
- error(err)
- end
- end
- end,
- --- @diagnostic disable-next-line: invisible, access-invisible, undefined-field
- on_buf = tshighlighter._on_buf,
- --- @diagnostic disable-next-line: invisible, access-invisible
- _on_spell_nav = tshighlighter._on_spell_nav,
- --- @diagnostic disable-next-line: invisible, access-invisible
- _on_conceal_line = tshighlighter._on_conceal_line,
- })
- end)
- end
Advertisement
Add Comment
Please, Sign In to add comment