From 472c3385d4b9fe8c3b55707accb646783298d0e2 Mon Sep 17 00:00:00 2001 From: Leo Tenenbaum Date: Sun, 7 Mar 2021 19:28:25 -0500 Subject: more find menu fixes --- find.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/find.c b/find.c index 8775712..0587b61 100644 --- a/find.c +++ b/find.c @@ -451,15 +451,15 @@ static void find_menu_frame(Ted *ted, Rect menu_bounds) { } static void find_open(Ted *ted, bool replace) { - if (ted->active_buffer && ted_is_regular_buffer(ted, ted->active_buffer)) { + if (ted->menu) return; + if (ted->active_buffer == &ted->build_buffer) return; + if (!ted->find) ted->prev_active_buffer = ted->active_buffer; - ted_switch_to_buffer(ted, &ted->find_buffer); - buffer_select_all(ted->active_buffer); - ted->find = true; - } else if (ted->find) { - ted->replace = replace; - find_update(ted, true); - } + ted_switch_to_buffer(ted, &ted->find_buffer); + buffer_select_all(ted->active_buffer); + ted->find = true; + ted->replace = replace; + find_update(ted, true); } static void find_close(Ted *ted) { -- cgit v1.2.3