Switch folds from c-style array to std::vector

This commit is contained in:
2025-12-07 18:18:54 +00:00
parent 7c94df1040
commit 2c3f8f2e46
3 changed files with 28 additions and 36 deletions

View File

@@ -105,7 +105,7 @@ void handle_editor_event(Editor *editor, KeyEvent event) {
lock_1.unlock();
std::unique_lock lock_2(editor->knot_mtx);
editor->root = insert(editor->root, pos, (char *)"\n", 1);
editor->folded = (int *)calloc(editor->root->line_count + 2, sizeof(int));
editor->folded.resize(editor->root->line_count + 2);
lock_2.unlock();
if (editor->tree) {
TSInputEdit edit = {