Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Add show line endings button to Settings UI (#55707)

George Watersf6d4d34d209f
diff --git a/crates/settings_ui/src/page_data.rs b/crates/settings_ui/src/page_data.rs
index 112aa5f5716..a43c566d1a7 100644
--- a/crates/settings_ui/src/page_data.rs
+++ b/crates/settings_ui/src/page_data.rs
@@ -3487,7 +3487,7 @@ fn search_and_files_page() -> SettingsPage {
}
fn window_and_layout_page() -> SettingsPage {
- fn status_bar_section() -> [SettingsPageItem; 10] {
+ fn status_bar_section() -> [SettingsPageItem; 11] {
[
SettingsPageItem::SectionHeader("Status Bar"),
SettingsPageItem::SettingItem(SettingItem {
@@ -3574,6 +3574,28 @@ fn window_and_layout_page() -> SettingsPage {
metadata: None,
files: USER,
}),
+ SettingsPageItem::SettingItem(SettingItem {
+ title: "Line Endings Button",
+ description: "Show the active line endings button in the status bar.",
+ field: Box::new(SettingField {
+ json_path: Some("status_bar.line_endings_button"),
+ pick: |settings_content| {
+ settings_content
+ .status_bar
+ .as_ref()?
+ .line_endings_button
+ .as_ref()
+ },
+ write: |settings_content, value, _| {
+ settings_content
+ .status_bar
+ .get_or_insert_default()
+ .line_endings_button = value;
+ },
+ }),
+ metadata: None,
+ files: USER,
+ }),
SettingsPageItem::SettingItem(SettingItem {
title: "Terminal Button",
description: "Show the terminal button in the status bar.",