Remove optional path argument when getting settings
This commit is contained in:
parent
1f0e79ee9d
commit
2d5f03e148
35 changed files with 84 additions and 113 deletions
|
@ -172,9 +172,8 @@ impl Dock {
|
|||
background_actions: BackgroundActions,
|
||||
cx: &mut ViewContext<Workspace>,
|
||||
) -> Self {
|
||||
let position = DockPosition::Hidden(
|
||||
settings::get_setting::<WorkspaceSettings>(None, cx).default_dock_anchor,
|
||||
);
|
||||
let position =
|
||||
DockPosition::Hidden(settings::get::<WorkspaceSettings>(cx).default_dock_anchor);
|
||||
let workspace = cx.weak_handle();
|
||||
let pane =
|
||||
cx.add_view(|cx| Pane::new(workspace, Some(position.anchor()), background_actions, cx));
|
||||
|
|
|
@ -450,7 +450,7 @@ impl<T: Item> ItemHandle for ViewHandle<T> {
|
|||
}
|
||||
|
||||
ItemEvent::Edit => {
|
||||
let settings = settings::get_setting::<WorkspaceSettings>(None, cx);
|
||||
let settings = settings::get::<WorkspaceSettings>(cx);
|
||||
let debounce_delay = settings.git.gutter_debounce;
|
||||
|
||||
if let AutosaveSetting::AfterDelay { milliseconds } =
|
||||
|
@ -501,7 +501,7 @@ impl<T: Item> ItemHandle for ViewHandle<T> {
|
|||
|
||||
cx.observe_focus(self, move |workspace, item, focused, cx| {
|
||||
if !focused
|
||||
&& settings::get_setting::<WorkspaceSettings>(None, cx).autosave
|
||||
&& settings::get::<WorkspaceSettings>(cx).autosave
|
||||
== AutosaveSetting::OnFocusChange
|
||||
{
|
||||
Pane::autosave_item(&item, workspace.project.clone(), cx)
|
||||
|
|
|
@ -1024,7 +1024,7 @@ impl Pane {
|
|||
} else if is_dirty && (can_save || is_singleton) {
|
||||
let will_autosave = cx.read(|cx| {
|
||||
matches!(
|
||||
settings::get_setting::<WorkspaceSettings>(None, cx).autosave,
|
||||
settings::get::<WorkspaceSettings>(cx).autosave,
|
||||
AutosaveSetting::OnFocusChange | AutosaveSetting::OnWindowChange
|
||||
) && Self::can_autosave_item(&*item, cx)
|
||||
});
|
||||
|
|
|
@ -379,8 +379,7 @@ impl PaneAxis {
|
|||
.with_children(self.members.iter().enumerate().map(|(ix, member)| {
|
||||
let mut flex = 1.0;
|
||||
if member.contains(active_pane) {
|
||||
flex = settings::get_setting::<WorkspaceSettings>(None, cx)
|
||||
.active_pane_magnification;
|
||||
flex = settings::get::<WorkspaceSettings>(cx).active_pane_magnification;
|
||||
}
|
||||
|
||||
let mut member = member.render(
|
||||
|
|
|
@ -2359,7 +2359,7 @@ impl Workspace {
|
|||
item.workspace_deactivated(cx);
|
||||
}
|
||||
if matches!(
|
||||
settings::get_setting::<WorkspaceSettings>(None, cx).autosave,
|
||||
settings::get::<WorkspaceSettings>(cx).autosave,
|
||||
AutosaveSetting::OnWindowChange | AutosaveSetting::OnFocusChange
|
||||
) {
|
||||
for item in pane.items() {
|
||||
|
@ -3140,7 +3140,7 @@ pub fn join_remote_project(
|
|||
}
|
||||
|
||||
pub fn restart(_: &Restart, cx: &mut AppContext) {
|
||||
let should_confirm = settings::get_setting::<WorkspaceSettings>(None, cx).confirm_quit;
|
||||
let should_confirm = settings::get::<WorkspaceSettings>(cx).confirm_quit;
|
||||
cx.spawn(|mut cx| async move {
|
||||
let mut workspaces = cx
|
||||
.window_ids()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue