summaryrefslogtreecommitdiff
path: root/ted.c
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2022-03-26 15:50:07 -0400
committerpommicket <pommicket@gmail.com>2022-03-26 15:50:07 -0400
commit6617f77adbaeb0dc79c7b07f6ec3a107adb117db (patch)
treed35c0cea859ff0c3fe0bf178111a0abd59ef9ce2 /ted.c
parent53ce10723f8d683dda4194fc969b4a8500b76b19 (diff)
fixed ctrl+w behavior with find/build
Diffstat (limited to 'ted.c')
-rw-r--r--ted.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/ted.c b/ted.c
index cb227fa..c5d264b 100644
--- a/ted.c
+++ b/ted.c
@@ -139,6 +139,19 @@ void ted_switch_to_buffer(Ted *ted, TextBuffer *buffer) {
}
}
+// set ted->active_buffer to something nice
+static void ted_reset_active_buffer(Ted *ted) {
+ if (ted->nodes_used[0]) {
+ Node *node = &ted->nodes[0];
+ while (!node->tabs)
+ node = &ted->nodes[node->split_a]; // arbitrarily pick split_a.
+ ted_switch_to_buffer(ted, &ted->buffers[node->tabs[node->active_tab]]);
+ } else {
+ // there's nothing to set it to
+ ted->active_buffer = NULL;
+ }
+}
+
// returns the index of an available buffer, or -1 if none are available
static i32 ted_new_buffer(Ted *ted) {