Guest User

Untitled

a guest
Aug 29th, 2025
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.18 KB | None | 0 0
  1. -- HACK: Workaround https://github.com/neovim/neovim/issues/29550
  2. if assert(vim.version.range('0.11.3 - 0.11.4')):has(vim.version()) then
  3.   vim.schedule(function()
  4.     local tshighlighter = require('vim.treesitter.highlighter')
  5.     local ns = vim.api.nvim_create_namespace('nvim.treesitter.highlighter')
  6.     vim.api.nvim_set_decoration_provider(ns, {
  7.       --- @diagnostic disable-next-line: invisible, access-invisible
  8.       on_win = tshighlighter._on_win,
  9.       on_line = function(...)
  10.         --- @diagnostic disable-next-line: invisible, access-invisible
  11.         local success, err = pcall(tshighlighter._on_line, ...)
  12.         if not success then
  13.           err = err --[[@as string]]
  14.           if not err:match('out of range') then
  15.             error(err)
  16.           end
  17.         end
  18.       end,
  19.       --- @diagnostic disable-next-line: invisible, access-invisible, undefined-field
  20.       on_buf = tshighlighter._on_buf,
  21.       --- @diagnostic disable-next-line: invisible, access-invisible
  22.       _on_spell_nav = tshighlighter._on_spell_nav,
  23.       --- @diagnostic disable-next-line: invisible, access-invisible
  24.       _on_conceal_line = tshighlighter._on_conceal_line,
  25.     })
  26.   end)
  27. end
  28.  
Advertisement
Add Comment
Please, Sign In to add comment