diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2021-01-24 14:56:00 -0500 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2021-01-24 14:56:00 -0500 |
commit | 8c5eb397121c7fb3fa7feb2391d7c9b674b4190b (patch) | |
tree | cee9002f9e748eb4ca1861dd137abf366ac0ecba /command.c | |
parent | b9079377328e9abeb20950ac144a7ebd98fde88e (diff) |
file selector much nicer interface
Diffstat (limited to 'command.c')
-rw-r--r-- | command.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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); |