summaryrefslogtreecommitdiff
path: root/command.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2021-02-28 16:35:38 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2021-02-28 16:35:38 -0500
commit52fd5e0c95da236fd14682ed8a7cfa34afbab2c0 (patch)
tree4f8ca7df068983ad6aa2de38a7862a9bb607f258 /command.c
parentfb2a0b9998a599f9e8a9a1e911fd43345778f6ef (diff)
set active_node to NULL when line buffer is active
Diffstat (limited to 'command.c')
-rw-r--r--command.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/command.c b/command.c
index 05f7c48..91819e4 100644
--- a/command.c
+++ b/command.c
@@ -99,7 +99,7 @@ void command_execute(Ted *ted, Command c, i64 argument) {
case CMD_TAB:
if (ted->replace && buffer == &ted->find_buffer) {
- buffer = ted->active_buffer = &ted->replace_buffer;
+ ted_switch_to_buffer(ted, &ted->replace_buffer);
buffer_select_all(buffer);
} else if (buffer) {
if (buffer->selection)
@@ -110,7 +110,7 @@ void command_execute(Ted *ted, Command c, i64 argument) {
break;
case CMD_BACKTAB:
if (ted->replace && buffer == &ted->replace_buffer) {
- buffer = ted->active_buffer = &ted->find_buffer;
+ ted_switch_to_buffer(ted, &ted->find_buffer);
buffer_select_all(buffer);
} else if (buffer) {
if (buffer->selection)
@@ -315,10 +315,10 @@ void command_execute(Ted *ted, Command c, i64 argument) {
}
break;
case CMD_SPLIT_JOIN:
- node_join(ted, node);
+ if (node) node_join(ted, node);
break;
case CMD_SPLIT_SWAP:
- node_split_swap(ted);
+ if (node) node_split_swap(ted);
break;
}
}