diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2021-03-01 17:41:24 -0500 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2021-03-01 17:41:24 -0500 |
commit | e85a89269be2f7d4cfe3c999a2b68097227c3e52 (patch) | |
tree | 3eb47c72d8c496e1226717ccfdeb1cc2b63addc8 /node.c | |
parent | d94f61b5d52d3372c006aad67ccd133926666f18 (diff) |
change active node when current one closed
Diffstat (limited to 'node.c')
-rw-r--r-- | node.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -105,6 +105,7 @@ static void node_close(Ted *ted, u16 node_idx) { ted->nodes_used[node_idx] = false; Node *node = &ted->nodes[node_idx]; + bool was_active = ted->active_node == node; // delete all associated buffers arr_foreach_ptr(node->tabs, u16, tab) { @@ -132,7 +133,7 @@ static void node_close(Ted *ted, u16 node_idx) { *parent = ted->nodes[other_side]; ted->nodes_used[other_side] = false; - if (ted->active_node == node) { + if (was_active) { Node *new_active_node = parent; // make sure we don't set the active node to a split while (!new_active_node->tabs) |