use std::num::NonZeroUsize; use collections::HashMap;use schemars::JsonSchema;use serde::{Deserialize, Serialize};use settings_macros::{MergeFrom, with_fallible_options}; use crate::{ CenteredPaddingSettings, CommandAliasTarget, DelayMs, DockPosition, DockSide, InactiveOpacity, ShowIndentGuides, ShowScrollbar, serialize_optional_f32_with_two_decimal_places,}; #[with_fallible_options]#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize, JsonSchema, MergeFrom)]pub struct WorkspaceSettingsContent { /// Active pane styling settings. pub active_pane_modifiers: Option<ActivePaneModifiers>, /// The text rendering mode to use. /// /// Default: platform_default pub text_rendering_mode: Option<TextRenderingMode>, /// Layout mode for the bottom dock /// /// Default: contained pub bottom_dock_layout: Option<BottomDockLayout>, /// Direction to split horizontally. /// /// Default: "up" pub pane_split_direction_horizontal: Option<PaneSplitDirectionHorizontal>, /// Direction to split vertically. /// /// Default: "left" pub pane_split_direction_vertical: Option<PaneSplitDirectionVertical>, /// Centered layout related settings. pub centered_layout: Option<CenteredLayoutSettings>, /// Whether or not to prompt the user to confirm before closing the application. /// /// Default: false pub confirm_quit: Option<bool>, /// Whether or not to show the call status icon in the status bar. /// /// Default: true pub show_call_status_icon: Option<bool>, /// When to automatically save edited buffers. /// /// Default: off pub autosave: Option<AutosaveSetting>, /// Controls previous session restoration in freshly launched Zed instance. /// Values: empty_tab, last_workspace, last_session, launchpad /// Default: last_session pub restore_on_startup: Option<RestoreOnStartupBehavior>, /// The default behavior when opening paths from the CLI without /// an explicit `-e` or `-n` flag. /// /// Default: existing_window pub cli_default_open_behavior: Option<CliDefaultOpenBehavior>, /// The default behavior when opening projects from the UI. /// /// Default: existing_window pub default_open_behavior: Option<DefaultOpenBehavior>, /// Whether to attempt to restore previous file's state when opening it again. /// The state is stored per pane. /// When disabled, defaults are applied instead of the state restoration. /// /// E.g. for editors, selections, folds and scroll positions are restored, if the same file is closed and, later, opened again in the same pane. /// When disabled, a single selection in the very beginning of the file, zero scroll position and no folds state is used as a default. /// /// Default: true pub restore_on_file_reopen: Option<bool>, /// The size of the workspace split drop targets on the outer edges. /// Given as a fraction that will be multiplied by the smaller dimension of the workspace. /// /// Default: `0.2` (20% of the smaller dimension of the workspace) #[serde(serialize_with = "serialize_optional_f32_with_two_decimal_places")] pub drop_target_size: Option<f32>, /// Whether to close the window when using 'close active item' on a workspace with no tabs /// /// Default: auto ("on" on macOS, "off" otherwise) pub when_closing_with_no_tabs: Option<CloseWindowWhenNoItems>, /// Whether to optimize Zed's interface for assistive technology such as /// screen readers. /// /// Default: false pub accessible_mode: Option<bool>, /// Whether to use the system provided dialogs for Open and Save As. /// When set to false, Zed will use the built-in keyboard-first pickers. /// /// Default: true pub use_system_path_prompts: Option<bool>, /// Whether to use the system provided prompts. /// When set to false, Zed will use the built-in prompts. /// Note that this setting has no effect on Linux, where Zed will always /// use the built-in prompts. /// /// Default: true pub use_system_prompts: Option<bool>, /// Aliases for the command palette. When you type a key in this map, /// it will be assumed to equal the value. /// /// Default: {} #[serde(default)] pub command_aliases: HashMap<String, CommandAliasTarget>, /// Maximum open tabs in a pane. Will not close an unsaved /// tab. Set to `None` for unlimited tabs. /// /// Default: none pub max_tabs: Option<NonZeroUsize>, /// What to do when the last window is closed /// /// Default: auto (nothing on macOS, "app quit" otherwise) pub on_last_window_closed: Option<OnLastWindowClosed>, /// Whether to resize all the panels in a dock when resizing the dock. /// /// Default: ["left"] pub resize_all_panels_in_dock: Option<Vec<DockPosition>>, /// Whether to automatically close files that have been deleted on disk. /// /// Default: false pub close_on_file_delete: Option<bool>, /// Whether to allow windows to tab together based on the user’s tabbing preference (macOS only). /// /// Default: false pub use_system_window_tabs: Option<bool>, /// Whether to show padding for zoomed panels. /// When enabled, zoomed bottom panels will have some top padding, /// while zoomed left/right panels will have padding to the right/left (respectively). /// /// Default: true pub zoomed_padding: Option<bool>, /// Whether toggling a panel (e.g. with its keyboard shortcut) also closes /// the panel when it is already focused, instead of just moving focus back /// to the editor. /// /// Default: false pub close_panel_on_toggle: Option<bool>, /// Controls whether Zed or the window manager or compositor draws window decorations on Linux. /// /// Default: client pub window_decorations: Option<WindowDecorations>, /// Whether the focused panel follows the mouse location /// Default: false pub focus_follows_mouse: Option<FocusFollowsMouse>,} #[with_fallible_options]#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize, JsonSchema, MergeFrom)]pub struct ItemSettingsContent { /// Whether to show the Git file status on a tab item. /// /// Default: false pub git_status: Option<bool>, /// Position of the close button in a tab. /// /// Default: right pub close_position: Option<ClosePosition>, /// Whether to show the file icon for a tab. /// /// Default: false pub file_icons: Option<bool>, /// What to do after closing the current tab. /// /// Default: history pub activate_on_close: Option<ActivateOnClose>, /// Which files containing diagnostic errors/warnings to mark in the tabs. /// This setting can take the following three values: /// /// Default: off pub show_diagnostics: Option<ShowDiagnostics>, /// Whether to always show the close button on tabs. /// /// Default: false pub show_close_button: Option<ShowCloseButton>,} #[with_fallible_options]#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize, JsonSchema, MergeFrom)]pub struct PreviewTabsSettingsContent { /// Whether to show opened editors as preview tabs. /// Preview tabs do not stay open, are reused until explicitly set to be kept open opened (via double-click or editing) and show file names in italic. /// /// Default: true pub enabled: Option<bool>, /// Whether to open tabs in preview mode when opened from the project panel with a single click. /// /// Default: true pub enable_preview_from_project_panel: Option<bool>, /// Whether to open tabs in preview mode when selected from the file finder. /// /// Default: false pub enable_preview_from_file_finder: Option<bool>, /// Whether to open tabs in preview mode when opened from a multibuffer. /// /// Default: true pub enable_preview_from_multibuffer: Option<bool>, /// Whether to open tabs in preview mode when code navigation is used to open a multibuffer. /// /// Default: false pub enable_preview_multibuffer_from_code_navigation: Option<bool>, /// Whether to open tabs in preview mode when code navigation is used to open a single file. /// /// Default: true pub enable_preview_file_from_code_navigation: Option<bool>, /// Whether to keep tabs in preview mode when code navigation is used to navigate away from them. /// If `enable_preview_file_from_code_navigation` or `enable_preview_multibuffer_from_code_navigation` is also true, the new tab may replace the existing one. /// /// Default: false pub enable_keep_preview_on_code_navigation: Option<bool>,} #[derive( Copy, Clone, Debug, PartialEq, Default, Serialize, Deserialize, JsonSchema, MergeFrom, strum::VariantArray, strum::VariantNames,)]#[serde(rename_all = "lowercase")]pub enum ClosePosition { Left, #[default] Right,} #[derive( Copy, Clone, Debug, PartialEq, Default, Serialize, Deserialize, JsonSchema, MergeFrom, strum::VariantArray, strum::VariantNames,)]#[serde(rename_all = "lowercase")]pub enum ShowCloseButton { Always, #[default] Hover, Hidden,} #[derive( Copy, Clone, Debug, Default, Serialize, Deserialize, JsonSchema, MergeFrom, PartialEq, Eq, strum::VariantArray, strum::VariantNames,)]#[serde(rename_all = "snake_case")]pub enum ShowDiagnostics { #[default] Off, Errors, All,} #[derive( Copy, Clone, Debug, PartialEq, Default, Serialize, Deserialize, JsonSchema, MergeFrom, strum::VariantArray, strum::VariantNames,)]#[serde(rename_all = "snake_case")]pub enum ActivateOnClose { #[default] History, Neighbour, LeftNeighbour,} #[with_fallible_options]#[derive(Copy, Clone, PartialEq, Debug, Default, Serialize, Deserialize, JsonSchema, MergeFrom)]#[serde(rename_all = "snake_case")]pub struct ActivePaneModifiers { /// Size of the border surrounding the active pane. /// When set to 0, the active pane doesn't have any border. /// The border is drawn inset. /// /// Default: `0.0` #[serde(serialize_with = "crate::serialize_optional_f32_with_two_decimal_places")] pub border_size: Option<f32>, /// Opacity of inactive panels. /// When set to 1.0, the inactive panes have the same opacity as the active one. /// If set to 0, the inactive panes content will not be visible at all. /// Values are clamped to the [0.0, 1.0] range. /// /// Default: `1.0` #[schemars(range(min = 0.0, max = 1.0))] pub inactive_opacity: Option<InactiveOpacity>,} #[derive( Copy, Clone, Debug, Default, Serialize, Deserialize, PartialEq, JsonSchema, MergeFrom, strum::VariantArray, strum::VariantNames,)]#[serde(rename_all = "snake_case")]pub enum BottomDockLayout { /// Contained between the left and right docks #[default] Contained, /// Takes up the full width of the window Full, /// Extends under the left dock while snapping to the right dock LeftAligned, /// Extends under the right dock while snapping to the left dock RightAligned,} /// Configures what draws Zed's window decorations on Linux./// This setting has no effect on other platforms.#[derive( Copy, Clone, Default, Debug, Serialize, Deserialize, PartialEq, JsonSchema, MergeFrom, strum::VariantArray, strum::VariantNames,)]#[serde(rename_all = "snake_case")]pub enum WindowDecorations { /// Zed draws its own window decorations/titlebar (client-side decoration). #[default] Client, /// The window manager or compositor draws the server-side window /// decorations (not supported by GNOME Wayland). Server,} #[derive( Copy, Clone, PartialEq, Default, Serialize, Deserialize, JsonSchema, MergeFrom, Debug, strum::VariantArray, strum::VariantNames,)]#[serde(rename_all = "snake_case")]pub enum CloseWindowWhenNoItems { /// Match platform conventions by default, so "on" on macOS and "off" everywhere else #[default] PlatformDefault, /// Close the window when there are no tabs CloseWindow, /// Leave the window open when there are no tabs KeepWindowOpen,} impl CloseWindowWhenNoItems { pub fn should_close(&self) -> bool { match self { CloseWindowWhenNoItems::PlatformDefault => cfg!(target_os = "macos"), CloseWindowWhenNoItems::CloseWindow => true, CloseWindowWhenNoItems::KeepWindowOpen => false, } }} #[derive( Copy, Clone, PartialEq, Eq, Default, Serialize, Deserialize, JsonSchema, MergeFrom, Debug, strum::VariantArray, strum::VariantNames,)]#[serde(rename_all = "snake_case")]pub enum CliDefaultOpenBehavior { /// Open directories as a new workspace in the current Zed window's sidebar. #[default] #[strum(serialize = "Add to Existing Window")] ExistingWindow, /// Open paths in a new window unless they are subpaths of an existing project. #[strum(serialize = "Open a New Window")] NewWindow,} #[derive( Copy, Clone, PartialEq, Eq, Default, Serialize, Deserialize, JsonSchema, MergeFrom, Debug, strum::VariantArray, strum::VariantNames,)]#[serde(rename_all = "snake_case")]pub enum DefaultOpenBehavior { /// Open projects in the current Zed window. #[default] #[strum(serialize = "Add to Existing Window")] ExistingWindow, /// Open projects in a new window. #[strum(serialize = "Open a New Window")] NewWindow,} #[derive( Copy, Clone, PartialEq, Eq, Default, Serialize, Deserialize, JsonSchema, MergeFrom, Debug, strum::VariantArray, strum::VariantNames,)]#[serde(rename_all = "snake_case")]pub enum RestoreOnStartupBehavior { /// Always start with an empty editor tab #[serde(alias = "none")] EmptyTab, /// Restore the workspace that was closed last. LastWorkspace, /// Restore all workspaces that were open when quitting Zed. #[default] LastSession, /// Show the launchpad with recent projects (no tabs). Launchpad,} #[with_fallible_options]#[derive(Clone, Default, Serialize, Deserialize, JsonSchema, MergeFrom, Debug, PartialEq)]pub struct TabBarSettingsContent { /// Whether or not to show the tab bar in the editor. /// /// Default: true pub show: Option<bool>, /// Whether or not to show the navigation history buttons in the tab bar. /// /// Default: true pub show_nav_history_buttons: Option<bool>, /// Whether or not to show the tab bar buttons. /// /// Default: true pub show_tab_bar_buttons: Option<bool>, /// Whether or not to show pinned tabs in a separate row. /// When enabled, pinned tabs appear in a top row and unpinned tabs in a bottom row. /// /// Default: false pub show_pinned_tabs_in_separate_row: Option<bool>,} #[with_fallible_options]Lines 1–500 of 1066. Load more
use std::num::NonZeroUsize; use collections::HashMap; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; use settings_macros::{MergeFrom, with_fallible_options}; use crate::{ CenteredPaddingSettings, CommandAliasTarget, DelayMs, DockPosition, DockSide, InactiveOpacity, ShowIndentGuides, ShowScrollbar, serialize_optional_f32_with_two_decimal_places, }; #[with_fallible_options] #[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize, JsonSchema, MergeFrom)] pub struct WorkspaceSettingsContent { /// Active pane styling settings. pub active_pane_modifiers: Option<ActivePaneModifiers>, /// The text rendering mode to use. /// /// Default: platform_default pub text_rendering_mode: Option<TextRenderingMode>, /// Layout mode for the bottom dock /// /// Default: contained pub bottom_dock_layout: Option<BottomDockLayout>, /// Direction to split horizontally. /// /// Default: "up" pub pane_split_direction_horizontal: Option<PaneSplitDirectionHorizontal>, /// Direction to split vertically. /// /// Default: "left" pub pane_split_direction_vertical: Option<PaneSplitDirectionVertical>, /// Centered layout related settings. pub centered_layout: Option<CenteredLayoutSettings>, /// Whether or not to prompt the user to confirm before closing the application. /// /// Default: false pub confirm_quit: Option<bool>, /// Whether or not to show the call status icon in the status bar. /// /// Default: true pub show_call_status_icon: Option<bool>, /// When to automatically save edited buffers. /// /// Default: off pub autosave: Option<AutosaveSetting>, /// Controls previous session restoration in freshly launched Zed instance. /// Values: empty_tab, last_workspace, last_session, launchpad /// Default: last_session pub restore_on_startup: Option<RestoreOnStartupBehavior>, /// The default behavior when opening paths from the CLI without /// an explicit `-e` or `-n` flag. /// /// Default: existing_window pub cli_default_open_behavior: Option<CliDefaultOpenBehavior>, /// The default behavior when opening projects from the UI. /// /// Default: existing_window pub default_open_behavior: Option<DefaultOpenBehavior>, /// Whether to attempt to restore previous file's state when opening it again. /// The state is stored per pane. /// When disabled, defaults are applied instead of the state restoration. /// /// E.g. for editors, selections, folds and scroll positions are restored, if the same file is closed and, later, opened again in the same pane. /// When disabled, a single selection in the very beginning of the file, zero scroll position and no folds state is used as a default. /// /// Default: true pub restore_on_file_reopen: Option<bool>, /// The size of the workspace split drop targets on the outer edges. /// Given as a fraction that will be multiplied by the smaller dimension of the workspace. /// /// Default: `0.2` (20% of the smaller dimension of the workspace) #[serde(serialize_with = "serialize_optional_f32_with_two_decimal_places")] pub drop_target_size: Option<f32>, /// Whether to close the window when using 'close active item' on a workspace with no tabs /// /// Default: auto ("on" on macOS, "off" otherwise) pub when_closing_with_no_tabs: Option<CloseWindowWhenNoItems>, /// Whether to optimize Zed's interface for assistive technology such as /// screen readers. /// /// Default: false pub accessible_mode: Option<bool>, /// Whether to use the system provided dialogs for Open and Save As. /// When set to false, Zed will use the built-in keyboard-first pickers. /// /// Default: true pub use_system_path_prompts: Option<bool>, /// Whether to use the system provided prompts. /// When set to false, Zed will use the built-in prompts. /// Note that this setting has no effect on Linux, where Zed will always /// use the built-in prompts. /// /// Default: true pub use_system_prompts: Option<bool>, /// Aliases for the command palette. When you type a key in this map, /// it will be assumed to equal the value. /// /// Default: {} #[serde(default)] pub command_aliases: HashMap<String, CommandAliasTarget>, /// Maximum open tabs in a pane. Will not close an unsaved /// tab. Set to `None` for unlimited tabs. /// /// Default: none pub max_tabs: Option<NonZeroUsize>, /// What to do when the last window is closed /// /// Default: auto (nothing on macOS, "app quit" otherwise) pub on_last_window_closed: Option<OnLastWindowClosed>, /// Whether to resize all the panels in a dock when resizing the dock. /// /// Default: ["left"] pub resize_all_panels_in_dock: Option<Vec<DockPosition>>, /// Whether to automatically close files that have been deleted on disk. /// /// Default: false pub close_on_file_delete: Option<bool>, /// Whether to allow windows to tab together based on the user’s tabbing preference (macOS only). /// /// Default: false pub use_system_window_tabs: Option<bool>, /// Whether to show padding for zoomed panels. /// When enabled, zoomed bottom panels will have some top padding, /// while zoomed left/right panels will have padding to the right/left (respectively). /// /// Default: true pub zoomed_padding: Option<bool>, /// Whether toggling a panel (e.g. with its keyboard shortcut) also closes /// the panel when it is already focused, instead of just moving focus back /// to the editor. /// /// Default: false pub close_panel_on_toggle: Option<bool>, /// Controls whether Zed or the window manager or compositor draws window decorations on Linux. /// /// Default: client pub window_decorations: Option<WindowDecorations>, /// Whether the focused panel follows the mouse location /// Default: false pub focus_follows_mouse: Option<FocusFollowsMouse>, } #[with_fallible_options] #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize, JsonSchema, MergeFrom)] pub struct ItemSettingsContent { /// Whether to show the Git file status on a tab item. /// /// Default: false pub git_status: Option<bool>, /// Position of the close button in a tab. /// /// Default: right pub close_position: Option<ClosePosition>, /// Whether to show the file icon for a tab. /// /// Default: false pub file_icons: Option<bool>, /// What to do after closing the current tab. /// /// Default: history pub activate_on_close: Option<ActivateOnClose>, /// Which files containing diagnostic errors/warnings to mark in the tabs. /// This setting can take the following three values: /// /// Default: off pub show_diagnostics: Option<ShowDiagnostics>, /// Whether to always show the close button on tabs. /// /// Default: false pub show_close_button: Option<ShowCloseButton>, } #[with_fallible_options] #[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize, JsonSchema, MergeFrom)] pub struct PreviewTabsSettingsContent { /// Whether to show opened editors as preview tabs. /// Preview tabs do not stay open, are reused until explicitly set to be kept open opened (via double-click or editing) and show file names in italic. /// /// Default: true pub enabled: Option<bool>, /// Whether to open tabs in preview mode when opened from the project panel with a single click. /// /// Default: true pub enable_preview_from_project_panel: Option<bool>, /// Whether to open tabs in preview mode when selected from the file finder. /// /// Default: false pub enable_preview_from_file_finder: Option<bool>, /// Whether to open tabs in preview mode when opened from a multibuffer. /// /// Default: true pub enable_preview_from_multibuffer: Option<bool>, /// Whether to open tabs in preview mode when code navigation is used to open a multibuffer. /// /// Default: false pub enable_preview_multibuffer_from_code_navigation: Option<bool>, /// Whether to open tabs in preview mode when code navigation is used to open a single file. /// /// Default: true pub enable_preview_file_from_code_navigation: Option<bool>, /// Whether to keep tabs in preview mode when code navigation is used to navigate away from them. /// If `enable_preview_file_from_code_navigation` or `enable_preview_multibuffer_from_code_navigation` is also true, the new tab may replace the existing one. /// /// Default: false pub enable_keep_preview_on_code_navigation: Option<bool>, } #[derive( Copy, Clone, Debug, PartialEq, Default, Serialize, Deserialize, JsonSchema, MergeFrom, strum::VariantArray, strum::VariantNames, )] #[serde(rename_all = "lowercase")] pub enum ClosePosition { Left, #[default] Right, } #[derive( Copy, Clone, Debug, PartialEq, Default, Serialize, Deserialize, JsonSchema, MergeFrom, strum::VariantArray, strum::VariantNames, )] #[serde(rename_all = "lowercase")] pub enum ShowCloseButton { Always, #[default] Hover, Hidden, } #[derive( Copy, Clone, Debug, Default, Serialize, Deserialize, JsonSchema, MergeFrom, PartialEq, Eq, strum::VariantArray, strum::VariantNames, )] #[serde(rename_all = "snake_case")] pub enum ShowDiagnostics { #[default] Off, Errors, All, } #[derive( Copy, Clone, Debug, PartialEq, Default, Serialize, Deserialize, JsonSchema, MergeFrom, strum::VariantArray, strum::VariantNames, )] #[serde(rename_all = "snake_case")] pub enum ActivateOnClose { #[default] History, Neighbour, LeftNeighbour, } #[with_fallible_options] #[derive(Copy, Clone, PartialEq, Debug, Default, Serialize, Deserialize, JsonSchema, MergeFrom)] #[serde(rename_all = "snake_case")] pub struct ActivePaneModifiers { /// Size of the border surrounding the active pane. /// When set to 0, the active pane doesn't have any border. /// The border is drawn inset. /// /// Default: `0.0` #[serde(serialize_with = "crate::serialize_optional_f32_with_two_decimal_places")] pub border_size: Option<f32>, /// Opacity of inactive panels. /// When set to 1.0, the inactive panes have the same opacity as the active one. /// If set to 0, the inactive panes content will not be visible at all. /// Values are clamped to the [0.0, 1.0] range. /// /// Default: `1.0` #[schemars(range(min = 0.0, max = 1.0))] pub inactive_opacity: Option<InactiveOpacity>, } #[derive( Copy, Clone, Debug, Default, Serialize, Deserialize, PartialEq, JsonSchema, MergeFrom, strum::VariantArray, strum::VariantNames, )] #[serde(rename_all = "snake_case")] pub enum BottomDockLayout { /// Contained between the left and right docks #[default] Contained, /// Takes up the full width of the window Full, /// Extends under the left dock while snapping to the right dock LeftAligned, /// Extends under the right dock while snapping to the left dock RightAligned, } /// Configures what draws Zed's window decorations on Linux. /// This setting has no effect on other platforms. #[derive( Copy, Clone, Default, Debug, Serialize, Deserialize, PartialEq, JsonSchema, MergeFrom, strum::VariantArray, strum::VariantNames, )] #[serde(rename_all = "snake_case")] pub enum WindowDecorations { /// Zed draws its own window decorations/titlebar (client-side decoration). #[default] Client, /// The window manager or compositor draws the server-side window /// decorations (not supported by GNOME Wayland). Server, } #[derive( Copy, Clone, PartialEq, Default, Serialize, Deserialize, JsonSchema, MergeFrom, Debug, strum::VariantArray, strum::VariantNames, )] #[serde(rename_all = "snake_case")] pub enum CloseWindowWhenNoItems { /// Match platform conventions by default, so "on" on macOS and "off" everywhere else #[default] PlatformDefault, /// Close the window when there are no tabs CloseWindow, /// Leave the window open when there are no tabs KeepWindowOpen, } impl CloseWindowWhenNoItems { pub fn should_close(&self) -> bool { match self { CloseWindowWhenNoItems::PlatformDefault => cfg!(target_os = "macos"), CloseWindowWhenNoItems::CloseWindow => true, CloseWindowWhenNoItems::KeepWindowOpen => false, } } } #[derive( Copy, Clone, PartialEq, Eq, Default, Serialize, Deserialize, JsonSchema, MergeFrom, Debug, strum::VariantArray, strum::VariantNames, )] #[serde(rename_all = "snake_case")] pub enum CliDefaultOpenBehavior { /// Open directories as a new workspace in the current Zed window's sidebar. #[default] #[strum(serialize = "Add to Existing Window")] ExistingWindow, /// Open paths in a new window unless they are subpaths of an existing project. #[strum(serialize = "Open a New Window")] NewWindow, } #[derive( Copy, Clone, PartialEq, Eq, Default, Serialize, Deserialize, JsonSchema, MergeFrom, Debug, strum::VariantArray, strum::VariantNames, )] #[serde(rename_all = "snake_case")] pub enum DefaultOpenBehavior { /// Open projects in the current Zed window. #[default] #[strum(serialize = "Add to Existing Window")] ExistingWindow, /// Open projects in a new window. #[strum(serialize = "Open a New Window")] NewWindow, } #[derive( Copy, Clone, PartialEq, Eq, Default, Serialize, Deserialize, JsonSchema, MergeFrom, Debug, strum::VariantArray, strum::VariantNames, )] #[serde(rename_all = "snake_case")] pub enum RestoreOnStartupBehavior { /// Always start with an empty editor tab #[serde(alias = "none")] EmptyTab, /// Restore the workspace that was closed last. LastWorkspace, /// Restore all workspaces that were open when quitting Zed. #[default] LastSession, /// Show the launchpad with recent projects (no tabs). Launchpad, } #[with_fallible_options] #[derive(Clone, Default, Serialize, Deserialize, JsonSchema, MergeFrom, Debug, PartialEq)] pub struct TabBarSettingsContent { /// Whether or not to show the tab bar in the editor. /// /// Default: true pub show: Option<bool>, /// Whether or not to show the navigation history buttons in the tab bar. /// /// Default: true pub show_nav_history_buttons: Option<bool>, /// Whether or not to show the tab bar buttons. /// /// Default: true pub show_tab_bar_buttons: Option<bool>, /// Whether or not to show pinned tabs in a separate row. /// When enabled, pinned tabs appear in a top row and unpinned tabs in a bottom row. /// /// Default: false pub show_pinned_tabs_in_separate_row: Option<bool>, } #[with_fallible_options]