Compare commits
1 Commits
github-tok
...
conflict-v
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a6c071c363 |
@@ -99,6 +99,9 @@
|
|||||||
"version_control.added": "#27a657ff",
|
"version_control.added": "#27a657ff",
|
||||||
"version_control.modified": "#d3b020ff",
|
"version_control.modified": "#d3b020ff",
|
||||||
"version_control.deleted": "#e06c76ff",
|
"version_control.deleted": "#e06c76ff",
|
||||||
|
"version_control.conflict_marker.ours": "#a1c1811a",
|
||||||
|
"version_control.conflict_marker.theirs": "#74ade81a",
|
||||||
|
"version_control.conflict_marker.border": "#d3b0201f",
|
||||||
"conflict": "#dec184ff",
|
"conflict": "#dec184ff",
|
||||||
"conflict.background": "#dec1841a",
|
"conflict.background": "#dec1841a",
|
||||||
"conflict.border": "#5d4c2fff",
|
"conflict.border": "#5d4c2fff",
|
||||||
@@ -478,6 +481,11 @@
|
|||||||
"version_control.added": "#27a657ff",
|
"version_control.added": "#27a657ff",
|
||||||
"version_control.modified": "#d3b020ff",
|
"version_control.modified": "#d3b020ff",
|
||||||
"version_control.deleted": "#e06c76ff",
|
"version_control.deleted": "#e06c76ff",
|
||||||
|
"version_control.conflict.ours_background": "#FF0000",
|
||||||
|
"version_control.conflict.ours_border": "#FF0000",
|
||||||
|
"version_control.conflict.theirs_background": "#e2e2faff",
|
||||||
|
"version_control.conflict.theirs_border": "#cbcdf6ff",
|
||||||
|
"version_control.conflict.divider_background": "#faf2e6ff",
|
||||||
"conflict": "#a48819ff",
|
"conflict": "#a48819ff",
|
||||||
"conflict.background": "#faf2e6ff",
|
"conflict.background": "#faf2e6ff",
|
||||||
"conflict.border": "#f4e7d1ff",
|
"conflict.border": "#f4e7d1ff",
|
||||||
|
|||||||
@@ -324,8 +324,7 @@ fn update_conflict_highlighting(
|
|||||||
cx: &mut Context<Editor>,
|
cx: &mut Context<Editor>,
|
||||||
) {
|
) {
|
||||||
log::debug!("update conflict highlighting for {conflict:?}");
|
log::debug!("update conflict highlighting for {conflict:?}");
|
||||||
let theme = cx.theme().clone();
|
|
||||||
let colors = theme.colors();
|
|
||||||
let outer_start = buffer
|
let outer_start = buffer
|
||||||
.anchor_in_excerpt(excerpt_id, conflict.range.start)
|
.anchor_in_excerpt(excerpt_id, conflict.range.start)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
@@ -345,11 +344,9 @@ fn update_conflict_highlighting(
|
|||||||
.anchor_in_excerpt(excerpt_id, conflict.theirs.end)
|
.anchor_in_excerpt(excerpt_id, conflict.theirs.end)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let ours_background = colors.version_control_conflict_ours_background;
|
let ours_background = cx.theme().colors().version_control_conflict_marker_ours;
|
||||||
let ours_marker = colors.version_control_conflict_ours_marker_background;
|
let theirs_background = cx.theme().colors().version_control_conflict_marker_theirs;
|
||||||
let theirs_background = colors.version_control_conflict_theirs_background;
|
let divider_background = cx.theme().colors().version_control_conflict_marker_border;
|
||||||
let theirs_marker = colors.version_control_conflict_theirs_marker_background;
|
|
||||||
let divider_background = colors.version_control_conflict_divider_background;
|
|
||||||
|
|
||||||
let options = RowHighlightOptions {
|
let options = RowHighlightOptions {
|
||||||
include_gutter: false,
|
include_gutter: false,
|
||||||
@@ -357,14 +354,14 @@ fn update_conflict_highlighting(
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Prevent diff hunk highlighting within the entire conflict region.
|
// Prevent diff hunk highlighting within the entire conflict region.
|
||||||
editor.highlight_rows::<ConflictsOuter>(
|
editor.highlight_rows::<ConflictsOuter>(outer_start..outer_end, theirs_background, options, cx);
|
||||||
outer_start..outer_end,
|
editor.highlight_rows::<ConflictsOurs>(our_start..our_end, ours_background, options, cx);
|
||||||
divider_background,
|
editor.highlight_rows::<ConflictsOursMarker>(
|
||||||
|
outer_start..our_start,
|
||||||
|
ours_background,
|
||||||
options,
|
options,
|
||||||
cx,
|
cx,
|
||||||
);
|
);
|
||||||
editor.highlight_rows::<ConflictsOurs>(our_start..our_end, ours_background, options, cx);
|
|
||||||
editor.highlight_rows::<ConflictsOursMarker>(outer_start..our_start, ours_marker, options, cx);
|
|
||||||
editor.highlight_rows::<ConflictsTheirs>(
|
editor.highlight_rows::<ConflictsTheirs>(
|
||||||
their_start..their_end,
|
their_start..their_end,
|
||||||
theirs_background,
|
theirs_background,
|
||||||
@@ -373,7 +370,7 @@ fn update_conflict_highlighting(
|
|||||||
);
|
);
|
||||||
editor.highlight_rows::<ConflictsTheirsMarker>(
|
editor.highlight_rows::<ConflictsTheirsMarker>(
|
||||||
their_end..outer_end,
|
their_end..outer_end,
|
||||||
theirs_marker,
|
theirs_background,
|
||||||
options,
|
options,
|
||||||
cx,
|
cx,
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -144,11 +144,9 @@ impl ThemeColors {
|
|||||||
version_control_renamed: MODIFIED_COLOR,
|
version_control_renamed: MODIFIED_COLOR,
|
||||||
version_control_conflict: orange().light().step_12(),
|
version_control_conflict: orange().light().step_12(),
|
||||||
version_control_ignored: gray().light().step_12(),
|
version_control_ignored: gray().light().step_12(),
|
||||||
version_control_conflict_ours_background: green().light().step_10().alpha(0.5),
|
version_control_conflict_marker_ours: green().light().step_10().alpha(0.5),
|
||||||
version_control_conflict_theirs_background: blue().light().step_10().alpha(0.5),
|
version_control_conflict_marker_theirs: blue().light().step_10().alpha(0.5),
|
||||||
version_control_conflict_ours_marker_background: green().light().step_10().alpha(0.7),
|
version_control_conflict_marker_border: Hsla::default(),
|
||||||
version_control_conflict_theirs_marker_background: blue().light().step_10().alpha(0.7),
|
|
||||||
version_control_conflict_divider_background: Hsla::default(),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -265,11 +263,9 @@ impl ThemeColors {
|
|||||||
version_control_renamed: MODIFIED_COLOR,
|
version_control_renamed: MODIFIED_COLOR,
|
||||||
version_control_conflict: orange().dark().step_12(),
|
version_control_conflict: orange().dark().step_12(),
|
||||||
version_control_ignored: gray().dark().step_12(),
|
version_control_ignored: gray().dark().step_12(),
|
||||||
version_control_conflict_ours_background: green().dark().step_10().alpha(0.5),
|
version_control_conflict_marker_ours: green().dark().step_10().alpha(0.5),
|
||||||
version_control_conflict_theirs_background: blue().dark().step_10().alpha(0.5),
|
version_control_conflict_marker_theirs: blue().dark().step_10().alpha(0.5),
|
||||||
version_control_conflict_ours_marker_background: green().dark().step_10().alpha(0.7),
|
version_control_conflict_marker_border: Hsla::default(),
|
||||||
version_control_conflict_theirs_marker_background: blue().dark().step_10().alpha(0.7),
|
|
||||||
version_control_conflict_divider_background: Hsla::default(),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -207,23 +207,9 @@ pub(crate) fn zed_default_dark() -> Theme {
|
|||||||
version_control_renamed: MODIFIED_COLOR,
|
version_control_renamed: MODIFIED_COLOR,
|
||||||
version_control_conflict: crate::orange().light().step_12(),
|
version_control_conflict: crate::orange().light().step_12(),
|
||||||
version_control_ignored: crate::gray().light().step_12(),
|
version_control_ignored: crate::gray().light().step_12(),
|
||||||
version_control_conflict_ours_background: crate::green()
|
version_control_conflict_marker_ours: crate::green().light().step_12().alpha(0.5),
|
||||||
.light()
|
version_control_conflict_marker_theirs: crate::blue().light().step_12().alpha(0.5),
|
||||||
.step_12()
|
version_control_conflict_marker_border: Hsla::default(),
|
||||||
.alpha(0.5),
|
|
||||||
version_control_conflict_theirs_background: crate::blue()
|
|
||||||
.light()
|
|
||||||
.step_12()
|
|
||||||
.alpha(0.5),
|
|
||||||
version_control_conflict_ours_marker_background: crate::green()
|
|
||||||
.light()
|
|
||||||
.step_12()
|
|
||||||
.alpha(0.7),
|
|
||||||
version_control_conflict_theirs_marker_background: crate::blue()
|
|
||||||
.light()
|
|
||||||
.step_12()
|
|
||||||
.alpha(0.7),
|
|
||||||
version_control_conflict_divider_background: Hsla::default(),
|
|
||||||
},
|
},
|
||||||
status: StatusColors {
|
status: StatusColors {
|
||||||
conflict: yellow,
|
conflict: yellow,
|
||||||
|
|||||||
@@ -592,24 +592,16 @@ pub struct ThemeColorsContent {
|
|||||||
pub version_control_ignored: Option<String>,
|
pub version_control_ignored: Option<String>,
|
||||||
|
|
||||||
/// Background color for row highlights of "ours" regions in merge conflicts.
|
/// Background color for row highlights of "ours" regions in merge conflicts.
|
||||||
#[serde(rename = "version_control.conflict.ours_background")]
|
#[serde(rename = "version_control.conflict_marker.ours")]
|
||||||
pub version_control_conflict_ours_background: Option<String>,
|
pub version_control_conflict_marker_ours: Option<String>,
|
||||||
|
|
||||||
/// Background color for row highlights of "theirs" regions in merge conflicts.
|
/// Background color for row highlights of "theirs" regions in merge conflicts.
|
||||||
#[serde(rename = "version_control.conflict.theirs_background")]
|
#[serde(rename = "version_control.conflict_marker.theirs")]
|
||||||
pub version_control_conflict_theirs_background: Option<String>,
|
pub version_control_conflict_marker_theirs: Option<String>,
|
||||||
|
|
||||||
/// Background color for row highlights of "ours" conflict markers in merge conflicts.
|
|
||||||
#[serde(rename = "version_control.conflict.ours_marker_background")]
|
|
||||||
pub version_control_conflict_ours_marker_background: Option<String>,
|
|
||||||
|
|
||||||
/// Background color for row highlights of "theirs" conflict markers in merge conflicts.
|
|
||||||
#[serde(rename = "version_control.conflict.theirs_marker_background")]
|
|
||||||
pub version_control_conflict_theirs_marker_background: Option<String>,
|
|
||||||
|
|
||||||
/// Background color for row highlights of the "ours"/"theirs" divider in merge conflicts.
|
/// Background color for row highlights of the "ours"/"theirs" divider in merge conflicts.
|
||||||
#[serde(rename = "version_control.conflict.divider_background")]
|
#[serde(rename = "version_control.conflict_marker.border")]
|
||||||
pub version_control_conflict_divider_background: Option<String>,
|
pub version_control_conflict_marker_border: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ThemeColorsContent {
|
impl ThemeColorsContent {
|
||||||
@@ -1067,24 +1059,16 @@ impl ThemeColorsContent {
|
|||||||
.and_then(|color| try_parse_color(color).ok())
|
.and_then(|color| try_parse_color(color).ok())
|
||||||
// Fall back to `conflict`, for backwards compatibility.
|
// Fall back to `conflict`, for backwards compatibility.
|
||||||
.or(status_colors.ignored),
|
.or(status_colors.ignored),
|
||||||
version_control_conflict_ours_background: self
|
version_control_conflict_marker_ours: self
|
||||||
.version_control_conflict_ours_background
|
.version_control_conflict_marker_ours
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.and_then(|color| try_parse_color(color).ok()),
|
.and_then(|color| try_parse_color(color).ok()),
|
||||||
version_control_conflict_theirs_background: self
|
version_control_conflict_marker_theirs: self
|
||||||
.version_control_conflict_theirs_background
|
.version_control_conflict_marker_theirs
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.and_then(|color| try_parse_color(color).ok()),
|
.and_then(|color| try_parse_color(color).ok()),
|
||||||
version_control_conflict_ours_marker_background: self
|
version_control_conflict_marker_border: self
|
||||||
.version_control_conflict_ours_marker_background
|
.version_control_conflict_marker_border
|
||||||
.as_ref()
|
|
||||||
.and_then(|color| try_parse_color(color).ok()),
|
|
||||||
version_control_conflict_theirs_marker_background: self
|
|
||||||
.version_control_conflict_theirs_marker_background
|
|
||||||
.as_ref()
|
|
||||||
.and_then(|color| try_parse_color(color).ok()),
|
|
||||||
version_control_conflict_divider_background: self
|
|
||||||
.version_control_conflict_divider_background
|
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.and_then(|color| try_parse_color(color).ok()),
|
.and_then(|color| try_parse_color(color).ok()),
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -265,12 +265,10 @@ pub struct ThemeColors {
|
|||||||
pub version_control_ignored: Hsla,
|
pub version_control_ignored: Hsla,
|
||||||
|
|
||||||
/// Represents the "ours" region of a merge conflict.
|
/// Represents the "ours" region of a merge conflict.
|
||||||
pub version_control_conflict_ours_background: Hsla,
|
pub version_control_conflict_marker_ours: Hsla,
|
||||||
/// Represents the "theirs" region of a merge conflict.
|
/// Represents the "theirs" region of a merge conflict.
|
||||||
pub version_control_conflict_theirs_background: Hsla,
|
pub version_control_conflict_marker_theirs: Hsla,
|
||||||
pub version_control_conflict_ours_marker_background: Hsla,
|
pub version_control_conflict_marker_border: Hsla,
|
||||||
pub version_control_conflict_theirs_marker_background: Hsla,
|
|
||||||
pub version_control_conflict_divider_background: Hsla,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(EnumIter, Debug, Clone, Copy, AsRefStr)]
|
#[derive(EnumIter, Debug, Clone, Copy, AsRefStr)]
|
||||||
|
|||||||
Reference in New Issue
Block a user