summaryrefslogtreecommitdiff
path: root/ted.c
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2023-01-09 21:59:51 -0500
committerpommicket <pommicket@gmail.com>2023-01-09 22:00:23 -0500
commit7f0255cb40bb85276191ec3ddffe507e53abf2ac (patch)
tree2376d10183d4085a7e8c85bba008f8ba3516d731 /ted.c
parentce158f26b9136b3fc831c6325ad911e3bf403a4b (diff)
fixed a bunch of windows stuff
also compile_commands.json does fix the usages problem!
Diffstat (limited to 'ted.c')
-rw-r--r--ted.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/ted.c b/ted.c
index dd2a759..d5335d4 100644
--- a/ted.c
+++ b/ted.c
@@ -387,6 +387,7 @@ static Status ted_open_buffer(Ted *ted, u16 *buffer_idx, u16 *tab) {
if (arr_len(node->tabs) < TED_MAX_TABS) {
arr_add(node->tabs, (u16)new_buffer_index);
TextBuffer *new_buffer = &ted->buffers[new_buffer_index];
+ buffer_create(new_buffer, ted);
node->active_tab = (u16)(arr_len(node->tabs) - 1);
*buffer_idx = (u16)new_buffer_index;
*tab = node->active_tab;
@@ -445,7 +446,6 @@ bool ted_open_file(Ted *ted, const char *filename) {
} else {
ted_error_from_buffer(ted, buffer);
node_tab_close(ted, ted->active_node, tab_idx);
- ted_delete_buffer(ted, (u16)buffer_idx);
return false;
}
} else {
@@ -472,7 +472,6 @@ bool ted_new_file(Ted *ted, const char *filename) {
} else {
ted_error_from_buffer(ted, buffer);
node_tab_close(ted, ted->active_node, tab_idx);
- ted_delete_buffer(ted, (u16)buffer_idx);
return false;
}
} else {