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