diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2021-03-03 14:30:48 -0500 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2021-03-03 14:30:48 -0500 |
commit | d5488ef5c47878e04045a91d204cf1ccbdd9cd05 (patch) | |
tree | 23d11ed78e0cf33776f810e285aada539c4f1f28 /command.c | |
parent | c59429d28718c1aae581f023d33466580118b0fc (diff) |
:tab-move-left/right
Diffstat (limited to 'command.c')
-rw-r--r-- | command.c | 17 |
1 files changed, 13 insertions, 4 deletions
@@ -268,15 +268,24 @@ void command_execute(Ted *ted, Command c, i64 argument) { } } break; case CMD_TAB_NEXT: - if (ted->active_node) node_tab_next(ted, ted->active_node, argument); + if (node) node_tab_next(ted, node, argument); break; case CMD_TAB_PREV: - if (ted->active_node) node_tab_prev(ted, ted->active_node, argument); + if (node) node_tab_prev(ted, node, argument); break; case CMD_TAB_SWITCH: - if (ted->active_node) node_tab_switch(ted, ted->active_node, argument); + if (node) node_tab_switch(ted, node, argument); break; - + case CMD_TAB_MOVE_LEFT: { + u16 active_tab = node->active_tab; + if (active_tab > 0) + node_tabs_swap(node, active_tab, active_tab - 1); + } break; + case CMD_TAB_MOVE_RIGHT: { + u16 active_tab = node->active_tab; + if (active_tab + 1 < arr_len(node->tabs)) + node_tabs_swap(node, active_tab, active_tab + 1); + } break; case CMD_FIND: if (buffer) find_open(ted, false); |