diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2021-04-20 14:51:50 -0400 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2021-04-20 14:51:50 -0400 |
commit | a57a9682e74ff3609acb2ca6697fc6fa94c23fb6 (patch) | |
tree | bbe848dd7e5c7ae259fbcfdf3253240bc564c8d8 /command.c | |
parent | f90d98c3c451aa5be2979ff05863b5aa8bee9336 (diff) |
:set-language, various other little things
Diffstat (limited to 'command.c')
-rw-r--r-- | command.c | 19 |
1 files changed, 18 insertions, 1 deletions
@@ -116,6 +116,10 @@ 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->menu == MENU_COMMAND_SELECTOR && buffer == &ted->argument_buffer) { + buffer = &ted->line_buffer; + ted_switch_to_buffer(ted, buffer); + buffer_select_all(buffer); } else if (ted->autocomplete) { autocomplete_select_cursor_completion(ted); } else if (buffer) { @@ -129,6 +133,10 @@ void command_execute(Ted *ted, Command c, i64 argument) { if (ted->replace && buffer == &ted->replace_buffer) { ted_switch_to_buffer(ted, &ted->find_buffer); buffer_select_all(buffer); + } else if (ted->menu == MENU_COMMAND_SELECTOR && buffer == &ted->line_buffer) { + buffer = &ted->argument_buffer; + ted_switch_to_buffer(ted, buffer); + buffer_select_all(buffer); } else if (buffer) { if (buffer->selection) buffer_dedent_selection(buffer); @@ -227,7 +235,15 @@ void command_execute(Ted *ted, Command c, i64 argument) { } } break; - + + case CMD_SET_LANGUAGE: + if (buffer && !buffer->is_line_buffer) { + if (argument < 0 || argument >= LANG_COUNT) + buffer->manual_language = -1; + else + buffer->manual_language = (i16)(argument + 1); + } + break; case CMD_AUTOCOMPLETE: if (ted->autocomplete) ++ted->autocomplete_cursor; @@ -238,6 +254,7 @@ void command_execute(Ted *ted, Command c, i64 argument) { if (ted->autocomplete) --ted->autocomplete_cursor; break; + case CMD_UNDO: if (buffer) buffer_undo(buffer, argument); break; |