diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2021-02-07 19:49:53 -0500 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2021-02-07 19:49:53 -0500 |
commit | b0506f2a667d0c1f4bddf7429068a4ee2042c039 (patch) | |
tree | d3d77d0b281f49e1707c722f092ff87ab96f9ec8 /command.c | |
parent | e802f33329f5c9c2a0630693d42c737d4b75b409 (diff) |
simple find menu
Diffstat (limited to 'command.c')
-rw-r--r-- | command.c | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -104,9 +104,15 @@ void command_execute(Ted *ted, Command c, i64 argument) { if (!buffer) { } else if (buffer->is_line_buffer) { switch (ted->menu) { + case MENU_NONE: + if (ted->find) { + if (buffer == &ted->find_buffer) { + find_next(ted); + } + } + break; case MENU_ASK_RELOAD: case MENU_WARN_UNSAVED: - case MENU_NONE: break; case MENU_OPEN: case MENU_SAVE_AS: { @@ -252,9 +258,7 @@ void command_execute(Ted *ted, Command c, i64 argument) { break; case CMD_FIND: - ted->find = true; - buffer_clear(&ted->find_buffer); - ted->active_buffer = &ted->find_buffer; + find_open(ted); break; case CMD_ESCAPE: @@ -263,6 +267,8 @@ void command_execute(Ted *ted, Command c, i64 argument) { *ted->error_shown = '\0'; } else if (ted->menu) { menu_escape(ted); + } else if (ted->find) { + find_close(ted); } else if (buffer) { buffer_disable_selection(buffer); } |