diff --git a/src/text_editor/plugin_search_window.cpp b/src/text_editor/plugin_search_window.cpp index 0490ee2..704de44 100644 --- a/src/text_editor/plugin_search_window.cpp +++ b/src/text_editor/plugin_search_window.cpp @@ -1,6 +1,7 @@ void CMD_Search() { BSet main = GetBSet(ActiveWindowID); String16 string = {}; + main.window->search_bar_anchor = main.view->carets[0]; if (main.view->carets.len == 1 && GetSize(main.view->carets[0]) > 0) { string = GetString(main.buffer, main.view->carets[0].range); } @@ -19,7 +20,6 @@ void SearchWindowFindNext(bool forward = true) { BSet set = GetBSet(SearchWindowID); String16 seek = GetString(set.buffer, GetRange(set.buffer)); Find(main.view, seek, forward); - main.window->search_bar_anchor = main.view->carets[0]; CenterView(PrimaryWindowID); } diff --git a/src/text_editor/text_editor.h b/src/text_editor/text_editor.h index 01c0bcc..328fa07 100644 --- a/src/text_editor/text_editor.h +++ b/src/text_editor/text_editor.h @@ -142,7 +142,7 @@ struct Window { double mouse_scroller_offset; int z; double weight; - Caret search_bar_anchor; + Caret search_bar_anchor; // maybe move to view @todo GotoCrumb begin_frame_crumb; Array goto_history;