summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2021-03-07 19:28:25 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2021-03-07 19:28:25 -0500
commit472c3385d4b9fe8c3b55707accb646783298d0e2 (patch)
tree0adbc7ded5fe29786da5008cc8fed2c6e1eae98a
parent5102b04327a6d91bafda0b705bf433f8916fcdcc (diff)
more find menu fixes
-rw-r--r--find.c16
1 files 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) {