From e364c7d0a6cfb655200015e27e7fcb5a4e745e20 Mon Sep 17 00:00:00 2001 From: Syed Daanish Date: Sun, 7 Dec 2025 19:53:43 +0000 Subject: [PATCH] Minor fixes --- .gitattributes | 1 + src/ts.cc | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitattributes b/.gitattributes index 67bc519..ad19ed1 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,3 @@ /libs/cjson/** linguist-vendored /libs/unicode_width/** linguist-vendored +*.scm linguist-language=tree-sitter-query diff --git a/src/ts.cc b/src/ts.cc index 9ef6f38..da9c22a 100644 --- a/src/ts.cc +++ b/src/ts.cc @@ -185,14 +185,14 @@ void ts_collect_spans(Editor *editor) { return; std::vector edits; TSInputEdit edit; - if (copy) { + if (copy) while (editor->edit_queue.pop(edit)) { edits.push_back(edit); ts_tree_edit(copy, &edits.back()); } - } tree = ts_parser_parse(editor->parser, copy, tsinput); - ts_tree_delete(copy); + if (copy) + ts_tree_delete(copy); while (editor->edit_queue.pop(edit)) { edits.push_back(edit); ts_tree_edit(tree, &edits.back());