summaryrefslogtreecommitdiff
path: root/command.c
diff options
context:
space:
mode:
Diffstat (limited to 'command.c')
-rw-r--r--command.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/command.c b/command.c
index 442989b..40636b6 100644
--- a/command.c
+++ b/command.c
@@ -19,6 +19,7 @@ char const *command_to_str(Command c) {
void command_execute(Ted *ted, Command c, i64 argument) {
TextBuffer *buffer = ted->active_buffer;
+ FileSelector *file_selector = &ted->file_selector;
Settings *settings = &ted->settings;
@@ -37,10 +38,12 @@ void command_execute(Ted *ted, Command c, i64 argument) {
if (buffer) buffer_cursor_move_right(buffer, argument);
break;
case CMD_UP:
- if (buffer) buffer_cursor_move_up(buffer, argument);
+ if (file_selector->open) file_selector_up(file_selector, argument);
+ else if (buffer) buffer_cursor_move_up(buffer, argument);
break;
case CMD_DOWN:
- if (buffer) buffer_cursor_move_down(buffer, argument);
+ if (file_selector->open) file_selector_down(file_selector, argument);
+ else if (buffer) buffer_cursor_move_down(buffer, argument);
break;
case CMD_SELECT_LEFT:
if (buffer) buffer_select_left(buffer, argument);