Skip to content

Commit f6d4d34

Browse files
authored
Add show line endings button to Settings UI (zed-industries#55707)
This is following up from zed-industries#39609 to add the line endings button setting into settings ui. Release Notes: - Added the line endings button setting to settings ui.
1 parent 3e046b4 commit f6d4d34

1 file changed

Lines changed: 23 additions & 1 deletion

File tree

crates/settings_ui/src/page_data.rs

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3487,7 +3487,7 @@ fn search_and_files_page() -> SettingsPage {
34873487
}
34883488

34893489
fn window_and_layout_page() -> SettingsPage {
3490-
fn status_bar_section() -> [SettingsPageItem; 10] {
3490+
fn status_bar_section() -> [SettingsPageItem; 11] {
34913491
[
34923492
SettingsPageItem::SectionHeader("Status Bar"),
34933493
SettingsPageItem::SettingItem(SettingItem {
@@ -3574,6 +3574,28 @@ fn window_and_layout_page() -> SettingsPage {
35743574
metadata: None,
35753575
files: USER,
35763576
}),
3577+
SettingsPageItem::SettingItem(SettingItem {
3578+
title: "Line Endings Button",
3579+
description: "Show the active line endings button in the status bar.",
3580+
field: Box::new(SettingField {
3581+
json_path: Some("status_bar.line_endings_button"),
3582+
pick: |settings_content| {
3583+
settings_content
3584+
.status_bar
3585+
.as_ref()?
3586+
.line_endings_button
3587+
.as_ref()
3588+
},
3589+
write: |settings_content, value, _| {
3590+
settings_content
3591+
.status_bar
3592+
.get_or_insert_default()
3593+
.line_endings_button = value;
3594+
},
3595+
}),
3596+
metadata: None,
3597+
files: USER,
3598+
}),
35773599
SettingsPageItem::SettingItem(SettingItem {
35783600
title: "Terminal Button",
35793601
description: "Show the terminal button in the status bar.",

0 commit comments

Comments
 (0)