summaryrefslogtreecommitdiff
path: root/command.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2021-03-04 09:48:53 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2021-03-04 09:48:53 -0500
commitc8fe98bf37f5364543b365d6d423a785c3c66452 (patch)
tree17b6fe875c7c1cdc8e6f1dd398dbcbe6bf8ad3b0 /command.c
parent6ef4720bba8fcb90bcbdca5d7766b76816fc58c5 (diff)
completion working, it seems
Diffstat (limited to 'command.c')
-rw-r--r--command.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/command.c b/command.c
index f246f64..9521b77 100644
--- a/command.c
+++ b/command.c
@@ -101,6 +101,8 @@ void command_execute(Ted *ted, Command c, i64 argument) {
if (ted->replace && buffer == &ted->find_buffer) {
ted_switch_to_buffer(ted, &ted->replace_buffer);
buffer_select_all(buffer);
+ } else if (ted->autocomplete) {
+ autocomplete_select_cursor_completion(ted);
} else if (buffer) {
if (buffer->selection)
buffer_indent_selection(buffer);
@@ -206,7 +208,14 @@ void command_execute(Ted *ted, Command c, i64 argument) {
break;
case CMD_AUTOCOMPLETE:
- autocomplete_open(ted);
+ if (ted->autocomplete)
+ ++ted->autocomplete_cursor;
+ else
+ autocomplete_open(ted);
+ break;
+ case CMD_AUTOCOMPLETE_BACK:
+ if (ted->autocomplete)
+ --ted->autocomplete_cursor;
break;
case CMD_UNDO:
if (buffer) buffer_undo(buffer, argument);
@@ -289,7 +298,7 @@ void command_execute(Ted *ted, Command c, i64 argument) {
} break;
case CMD_TAB_MOVE_RIGHT: {
u16 active_tab = node->active_tab;
- if (active_tab + 1 < arr_len(node->tabs))
+ if ((uint)active_tab + 1 < arr_len(node->tabs))
node_tabs_swap(node, active_tab, active_tab + 1);
} break;
case CMD_FIND: