| @@ -9,7 +9,7 @@ use any_vec::AnyVec; · 8 unmodified lines |
| 9 | 9 | use collections::HashMap; |
| 10 | 10 | use editor::{ |
| 11 | 11 | actions::{Tab, TabPrev}, |
| 12 | | − DisplayPoint, Editor, EditorElement, EditorSettings, EditorStyle, SearchSettings, |
| 12 | + DisplayPoint, Editor, EditorElement, EditorSettings, EditorStyle, |
| 13 | 13 | }; |
| 14 | 14 | use futures::channel::oneshot; |
| 15 | 15 | use gpui::{ |
| @@ -22,7 +22,7 @@ use project::{ · 6 unmodified lines |
| 22 | 22 | search_history::{SearchHistory, SearchHistoryCursor}, |
| 23 | 23 | }; |
| 24 | 24 | use serde::Deserialize; |
| 25 | | −use settings::{Settings, SettingsStore}; |
| 25 | +use settings::Settings; |
| 26 | 26 | use std::sync::Arc; |
| 27 | 27 | use theme::ThemeSettings; |
| 28 | 28 | |
| @@ -96,7 +96,6 @@ pub struct BufferSearchBar { · 67 unmodified lines |
| 96 | 96 | scroll_handle: ScrollHandle, |
| 97 | 97 | editor_scroll_handle: ScrollHandle, |
| 98 | 98 | editor_needed_width: Pixels, |
| 99 | | − _subscriptions: Vec<Subscription>, |
| 100 | 99 | } |
| 101 | 100 | |
| 102 | 101 | impl BufferSearchBar { |
| @@ -506,11 +505,7 @@ impl BufferSearchBar { · 403 unmodified lines |
| 506 | 505 | cx.subscribe(&replacement_editor, Self::on_replacement_editor_event) |
| 507 | 506 | .detach(); |
| 508 | 507 | |
| 509 | | − let search_options = SearchOptions::from_settings(&SearchSettings::get_global(cx)); |
| 510 | | − |
| 511 | | − let settings_subscription = cx.observe_global::<SettingsStore>(move |this, cx| { |
| 512 | | − this.default_options = SearchOptions::from_settings(&SearchSettings::get_global(cx)); |
| 513 | | − }); |
| 508 | + let search_options = SearchOptions::from_settings(&EditorSettings::get_global(cx).search); |
| 514 | 509 | |
| 515 | 510 | Self { |
| 516 | 511 | query_editor, |
| @@ -537,7 +532,6 @@ impl BufferSearchBar { · 20 unmodified lines |
| 537 | 532 | scroll_handle: ScrollHandle::new(), |
| 538 | 533 | editor_scroll_handle: ScrollHandle::new(), |
| 539 | 534 | editor_needed_width: px(0.), |
| 540 | | − _subscriptions: vec![settings_subscription], |
| 541 | 535 | } |
| 542 | 536 | } |
| 543 | 537 | |
| @@ -610,6 +604,9 @@ impl BufferSearchBar { · 66 unmodified lines |
| 610 | 604 | let Some(handle) = self.active_searchable_item.as_ref() else { |
| 611 | 605 | return false; |
| 612 | 606 | }; |
| 607 | + |
| 608 | + self.default_options = SearchOptions::from_settings(&EditorSettings::get_global(cx).search); |
| 609 | + |
| 613 | 610 | if self.default_options != self.search_options { |
| 614 | 611 | self.search_options = self.default_options; |
| 615 | 612 | } |