mirror of
https://github.com/zed-industries/zed.git
synced 2024-09-16 00:47:39 +03:00
Make Theme::default have a non-empty replica theme vector
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
parent
92353b6967
commit
76c07fb232
@ -75,7 +75,7 @@ pub struct UiTheme {
|
||||
pub modal_match_text_highlight: Color,
|
||||
}
|
||||
|
||||
#[derive(Clone, Default, Deserialize)]
|
||||
#[derive(Clone, Deserialize)]
|
||||
#[serde(default)]
|
||||
pub struct EditorTheme {
|
||||
pub background: Color,
|
||||
@ -87,7 +87,7 @@ pub struct EditorTheme {
|
||||
pub replicas: Vec<ReplicaTheme>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Deserialize)]
|
||||
#[derive(Clone, Copy, Deserialize, Default)]
|
||||
pub struct ReplicaTheme {
|
||||
pub cursor: Color,
|
||||
pub selection: Color,
|
||||
@ -235,6 +235,20 @@ impl Theme {
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for EditorTheme {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
background: Default::default(),
|
||||
gutter_background: Default::default(),
|
||||
active_line_background: Default::default(),
|
||||
line_number: Default::default(),
|
||||
line_number_active: Default::default(),
|
||||
default_text: Default::default(),
|
||||
replicas: vec![ReplicaTheme::default()],
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl ThemeMap {
|
||||
pub fn new(capture_names: &[String], theme: &Theme) -> Self {
|
||||
// For each capture name in the highlight query, find the longest
|
||||
|
Loading…
Reference in New Issue
Block a user