Skip to content

Commit a3041c2

Browse files
committed
Amendments to resolve merge conflict and fix clippy errors
1 parent 7f76de5 commit a3041c2

File tree

3 files changed

+22
-27
lines changed

3 files changed

+22
-27
lines changed

crates/git_ui/src/git_panel.rs

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4169,7 +4169,6 @@ impl GitPanel {
41694169
h_flex()
41704170
.items_center()
41714171
.flex_1()
4172-
// .overflow_hidden()
41734172
.when_some(old_path.as_ref(), |this, old_path| {
41744173
let new_display = old_path.display(path_style).to_string();
41754174
let old_display = entry.repo_path.display(path_style).to_string();
@@ -4178,29 +4177,25 @@ impl GitPanel {
41784177
.child(self.entry_label(new_display, label_color))
41794178
})
41804179
.when(old_path.is_none(), |this| {
4181-
this.
4182-
.when(git_path_style == GitPathStyle::FileNameFirst, |this| {
4183-
name_label(status, label_color, this, format!("{display_name} "))
4184-
})
4185-
.when_some(
4186-
entry.parent_dir(path_style),
4187-
|this, parent| {
4188-
if !parent.is_empty() {
4189-
this.child(
4190-
self.entry_label(
4191-
format!("{parent}{}", path_style.separator()),
4192-
path_color,
4193-
)
4194-
.when(status.is_deleted(), |this| this.strikethrough()),
4180+
this.when(git_path_style == GitPathStyle::FileNameFirst, |this| {
4181+
name_label(status, label_color, this, format!("{display_name} "))
4182+
})
4183+
.when_some(entry.parent_dir(path_style), |this, parent| {
4184+
if !parent.is_empty() {
4185+
this.child(
4186+
self.entry_label(
4187+
format!("{parent}{}", path_style.separator()),
4188+
path_color,
41954189
)
4196-
} else {
4197-
this
4198-
}
4199-
},
4200-
)
4190+
.when(status.is_deleted(), |this| this.strikethrough()),
4191+
)
4192+
} else {
4193+
this
4194+
}
4195+
})
42014196
.when(git_path_style == GitPathStyle::FilePathFirst, |this| {
42024197
name_label(status, label_color, this, display_name)
4203-
}),
4198+
})
42044199
}),
42054200
)
42064201
.into_any_element()

crates/settings_ui/src/page_data.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5495,13 +5495,13 @@ pub(crate) fn settings_data(cx: &App) -> Vec<SettingsPage> {
54955495
files: USER,
54965496
}),
54975497
SettingsPageItem::SettingItem(SettingItem {
5498-
title: "Show Change Counters",
5499-
description: "When to show change counters in the git gutter.",
5498+
title: "Path Style",
5499+
description: "Should the name or path be displayed first in the git view.",
55005500
field: Box::new(SettingField {
5501-
json_path: Some("git.show_change_counters"),
5502-
pick: |settings_content| settings_content.git.as_ref()?.show_change_counters.as_ref(),
5501+
json_path: Some("git.path_style"),
5502+
pick: |settings_content| settings_content.git.as_ref()?.path_style.as_ref(),
55035503
write: |settings_content, value| {
5504-
settings_content.git.get_or_insert_default().show_change_counters = value;
5504+
settings_content.git.get_or_insert_default().path_style = value;
55055505
},
55065506
}),
55075507
metadata: None,

crates/settings_ui/src/settings_ui.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ fn init_renderers(cx: &mut App) {
452452
.add_basic_renderer::<settings::DockPosition>(render_dropdown)
453453
.add_basic_renderer::<settings::GitGutterSetting>(render_dropdown)
454454
.add_basic_renderer::<settings::GitHunkStyleSetting>(render_dropdown)
455-
.add_basic_renderer::<settings::GitShowChangeCounters>(render_dropdown)
455+
.add_basic_renderer::<settings::GitPathStyle>(render_dropdown)
456456
.add_basic_renderer::<settings::DiagnosticSeverityContent>(render_dropdown)
457457
.add_basic_renderer::<settings::SeedQuerySetting>(render_dropdown)
458458
.add_basic_renderer::<settings::DoubleClickInMultibuffer>(render_dropdown)

0 commit comments

Comments
 (0)