diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2021-03-07 19:28:25 -0500 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2021-03-07 19:28:25 -0500 |
commit | 472c3385d4b9fe8c3b55707accb646783298d0e2 (patch) | |
tree | 0adbc7ded5fe29786da5008cc8fed2c6e1eae98a | |
parent | 5102b04327a6d91bafda0b705bf433f8916fcdcc (diff) |
more find menu fixes
-rw-r--r-- | find.c | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -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) { |