treesitter: call bufload before parsing (#12603)

This commit is contained in:
Thomas Vigouroux
2020-07-10 15:33:27 +02:00
committed by GitHub
parent b39edb5b60
commit 529251d5e4
2 changed files with 8 additions and 3 deletions

View File

@@ -75,6 +75,9 @@ function M.create_parser(bufnr, lang, id)
if bufnr == 0 then
bufnr = a.nvim_get_current_buf()
end
vim.fn.bufload(bufnr)
local self = setmetatable({bufnr=bufnr, lang=lang, valid=false}, Parser)
self._parser = vim._create_ts_parser(lang)
self.change_cbs = {}