Move diff highlight for split view in editor theme

This commit is contained in:
Silvano Cerza 2025-03-09 17:20:18 +01:00
parent 928ad73696
commit 42c15f4479
2 changed files with 9 additions and 15 deletions

View file

@ -4,21 +4,6 @@ import EditorPane from "./editor-pane";
import ActionsGutter from "./actions-gutter";
import * as React from "react";
// Add styles for diff highlighting
const styles = document.createElement("style");
styles.innerHTML = `
.diff-modify-background {
background-color: rgba(var(--color-yellow-rgb), 0.1);
}
.diff-add-background {
background-color: rgba(var(--color-green-rgb), 0.1);
}
.diff-remove-background {
background-color: rgba(var(--color-red-rgb), 0.1);
}
`;
document.head.appendChild(styles);
interface DiffViewProps {
remoteText: string;
localText: string;

View file

@ -50,6 +50,15 @@ const EditorPane: React.FC<EditorPaneProps> = (props) => {
"&.cm-focused .cm-cursor": {
borderLeftColor: "var(--text-normal)",
},
".diff-modify-background": {
backgroundColor: "rgba(var(--color-yellow-rgb), 0.1)",
},
".diff-add-background": {
backgroundColor: "rgba(var(--color-green-rgb), 0.1)",
},
".diff-remove-background": {
backgroundColor: "rgba(var(--color-red-rgb), 0.1)",
},
}),
markdown(),
EditorView.domEventObservers({