From 06c7b7dfaafa94f35f75f31b36fd49dbc6ca7af1 Mon Sep 17 00:00:00 2001 From: Syed Daanish Date: Fri, 12 Dec 2025 21:03:05 +0000 Subject: [PATCH] Bump highlight limits --- src/editor.cc | 2 +- src/ts.cc | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/editor.cc b/src/editor.cc index 1e8f8e0..d4fb27a 100644 --- a/src/editor.cc +++ b/src/editor.cc @@ -28,7 +28,7 @@ Editor *new_editor(const char *filename, Coord position, Coord size) { editor->root = load(str, len, optimal_chunk_size(len)); free(str); editor->folded.resize(editor->root->line_count + 2); - if (len < (1024 * 128)) { + if (len <= (1024 * 128)) { editor->parser = ts_parser_new(); Language language = language_for_file(filename); editor->language = language.fn(); diff --git a/src/ts.cc b/src/ts.cc index 1977f89..24c390d 100644 --- a/src/ts.cc +++ b/src/ts.cc @@ -126,6 +126,8 @@ static inline bool ts_predicate(TSQuery *query, const TSQueryMatch &match, ts_query_predicates_for_pattern(query, match.pattern_index, &step_count); if (!steps || step_count != 4) return true; + if (source->char_count >= (1024 * 64)) + return false; std::string command; std::string regex_txt; uint32_t subject_id = 0;