diff --git a/src/nvim/lua/treesitter.c b/src/nvim/lua/treesitter.c index 5d3599920e..4c39cb332f 100644 --- a/src/nvim/lua/treesitter.c +++ b/src/nvim/lua/treesitter.c @@ -545,7 +545,8 @@ static int parser_parse(lua_State *L) .progress_callback = on_parser_progress }; new_tree = ts_parser_parse_with_options(p, old_tree, input, parse_options); } else { - new_tree = ts_parser_parse(p, old_tree, input); + // Tree-sitter retains parse options after use, so we must explicitly reset them here. + new_tree = ts_parser_parse_with_options(p, old_tree, input, (TSParseOptions) { 0 }); } break;