diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2021-01-26 15:42:34 -0500 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2021-01-26 15:42:34 -0500 |
commit | 65b6850a7dc3211566993f8a2cfacf61f5b4d6a2 (patch) | |
tree | 6fb8cc7417273db106d921224c990f78d8f3cdf4 /command.c | |
parent | 3050f7539aa780f15ea1ae4bd0296dfbb57b8e03 (diff) |
auto-indent
Diffstat (limited to 'command.c')
-rw-r--r-- | command.c | 32 |
1 files changed, 19 insertions, 13 deletions
@@ -97,6 +97,25 @@ void command_execute(Ted *ted, Command c, i64 argument) { if (buffer) buffer_select_all(buffer); break; + case CMD_TAB: + buffer_insert_char_at_cursor(buffer, '\t'); + break; + case CMD_NEWLINE: + if (buffer->is_line_buffer) { + switch (ted->menu) { + case MENU_NONE: + assert(0); + break; + case MENU_OPEN: + case MENU_SAVE_AS: { + ted->file_selector.submitted = true; + } break; + } + } else { + buffer_newline(buffer); + } + break; + case CMD_BACKSPACE: if (buffer) buffer_backspace_at_cursor(buffer, argument); break; @@ -172,19 +191,6 @@ void command_execute(Ted *ted, Command c, i64 argument) { buffer_disable_selection(buffer); } break; - case CMD_SUBMIT_LINE_BUFFER: - if (buffer->is_line_buffer) { - switch (ted->menu) { - case MENU_NONE: - assert(0); - break; - case MENU_OPEN: - case MENU_SAVE_AS: { - ted->file_selector.submitted = true; - } break; - } - } - break; } if (buffer && buffer_haserr(buffer)) { |