summaryrefslogtreecommitdiff
path: root/ted.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2021-02-28 14:41:58 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2021-02-28 14:41:58 -0500
commitfb2a0b9998a599f9e8a9a1e911fd43345778f6ef (patch)
tree5c3ebf1b7afa1654ad1f9e9db7d765378044e3c8 /ted.c
parent5662c988fa199d071fdfd9e9defd8e09a3486b0c (diff)
:split-swap
Diffstat (limited to 'ted.c')
-rw-r--r--ted.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/ted.c b/ted.c
index fcc1bb1..17f2205 100644
--- a/ted.c
+++ b/ted.c
@@ -130,6 +130,13 @@ static i32 ted_new_node(Ted *ted) {
}
+// switch to this node
+static void ted_node_switch(Ted *ted, Node *node) {
+ ted->active_node = node;
+ assert(node->tabs);
+ ted->active_buffer = &ted->buffers[node->tabs[node->active_tab]];
+}
+
static bool node_tab_close(Ted *ted, Node *node, u16 index);
// Open a new buffer. Fills out *tab to the index of the tab used, and *buffer_idx to the index of the buffer.
@@ -187,6 +194,7 @@ static void ted_switch_to_buffer(Ted *ted, u16 buffer_idx) {
assert(0);
}
+
// Returns true on success
static bool ted_open_file(Ted *ted, char const *filename) {
// first, check if file is already open