Properly register buffer_search'es actions handlers

Now those handlers do not intercept events/actions when the buffer search bar is dismissed.

co-authored-by: Piotr <piotr@zed.dev>
This commit is contained in:
Kirill Bulatov 2024-01-17 21:09:28 +02:00
parent 306e4693fa
commit 0be2f7f328
2 changed files with 100 additions and 66 deletions

View file

@ -93,19 +93,15 @@ pub fn init(cx: &mut AppContext) {
}
*/
.register_action(move |workspace, action: &SelectNextMatch, cx| {
dbg!("@@@@@@@@@1");
if workspace.has_active_modal(cx) {
cx.propagate();
return;
}
dbg!("????? 2");
let pane = workspace.active_pane();
pane.update(cx, move |this, cx| {
this.toolbar().update(cx, move |this, cx| {
dbg!("@@@@@@@@@ 3");
if let Some(search_bar) = this.item_of_type::<ProjectSearchBar>() {
dbg!("$$$$$$$$$ 4");
search_bar.update(cx, move |search_bar, cx| {
search_bar.select_next_match(action, cx)
});