diff options
author | Thomas Vigouroux <39092278+vigoux@users.noreply.github.com> | 2020-07-10 15:33:27 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-10 09:33:27 -0400 |
commit | 529251d5e49ed869aa9b4b3a168e97c8e30211d6 (patch) | |
tree | 5499785b8e15bdd738ec3b8e129e948c1bfd6ee5 /src/nvim | |
parent | b39edb5b605b545843482c70a3a3d03e2331a059 (diff) | |
download | rneovim-529251d5e49ed869aa9b4b3a168e97c8e30211d6.tar.gz rneovim-529251d5e49ed869aa9b4b3a168e97c8e30211d6.tar.bz2 rneovim-529251d5e49ed869aa9b4b3a168e97c8e30211d6.zip |
treesitter: call bufload before parsing (#12603)
Diffstat (limited to 'src/nvim')
-rw-r--r-- | src/nvim/lua/treesitter.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/nvim/lua/treesitter.c b/src/nvim/lua/treesitter.c index ddf54720a7..138031237e 100644 --- a/src/nvim/lua/treesitter.c +++ b/src/nvim/lua/treesitter.c @@ -307,11 +307,13 @@ static int parser_parse_buf(lua_State *L) } long bufnr = lua_tointeger(L, 2); - void *payload = handle_get_buffer(bufnr); - if (!payload) { + buf_T *buf = handle_get_buffer(bufnr); + + if (!buf) { return luaL_error(L, "invalid buffer handle: %d", bufnr); } - TSInput input = { payload, input_cb, TSInputEncodingUTF8 }; + + TSInput input = { (void *)buf, input_cb, TSInputEncodingUTF8 }; TSTree *new_tree = ts_parser_parse(p->parser, p->tree, input); uint32_t n_ranges = 0; |