summaryrefslogtreecommitdiff
path: root/editor.c
diff options
context:
space:
mode:
Diffstat (limited to 'editor.c')
-rw-r--r--editor.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/editor.c b/editor.c
index ade6a77..9f51188 100644
--- a/editor.c
+++ b/editor.c
@@ -331,3 +331,11 @@ void editor_draw_message_bar(struct editor_state* editor, struct append_buffer*
if (message_length && time(NULL) - editor->status_message_time < 5)
ab_append(buffer, editor->status_message, message_length);
}
+
+void editor_destroy(struct editor_state *editor)
+{
+ free(editor->filename);
+ for (int i = 0; i < editor->row_count; i++)
+ free_row(&editor->rows[i]);
+ free(editor->rows);
+}