summaryrefslogtreecommitdiff
path: root/command.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2021-02-07 19:49:53 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2021-02-07 19:49:53 -0500
commitb0506f2a667d0c1f4bddf7429068a4ee2042c039 (patch)
treed3d77d0b281f49e1707c722f092ff87ab96f9ec8 /command.c
parente802f33329f5c9c2a0630693d42c737d4b75b409 (diff)
simple find menu
Diffstat (limited to 'command.c')
-rw-r--r--command.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/command.c b/command.c
index 5c6ae29..0dd2b34 100644
--- a/command.c
+++ b/command.c
@@ -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);
}