mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
perf: don't compute locals on buffer updates
Instead we lazily evaluate them on request.
This allow two things :
* better performances
* being sure the locas are up to date
This commit is contained in:
parent
d169c0614c
commit
d25549917d
2 changed files with 11 additions and 15 deletions
|
|
@ -9,12 +9,6 @@ local M = {}
|
|||
-- this is the main interface through the plugin
|
||||
function M.setup(lang)
|
||||
if parsers.has_parser(lang) then
|
||||
if locals.is_supported(lang) then
|
||||
print("Locals setup for", lang)
|
||||
api.nvim_command(string.format([[
|
||||
autocmd NvimTreesitter FileType %s lua vim.api.nvim_buf_attach(0, true, {on_lines=require'nvim-treesitter.locals'.on_lines})
|
||||
]], lang))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue