Bump highlight limits

This commit is contained in:
2025-12-12 21:03:05 +00:00
parent fd70a40a49
commit 06c7b7dfaa
2 changed files with 3 additions and 1 deletions

View File

@@ -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();

View File

@@ -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;