дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-12-06 10:07:11 +02:00
Settings > Editor > Color Scheme > Diff & Merge now previews the colours in a three-pane merge view (left / result / right) painted with the same CodeMirror diff decorations as a real merge, including a folded unchanged fragment with the wave separator. Clicking a coloured line selects its attribute. The preview is a mergeSchemePreview editor kind registered from the VCS settings pages, so it also works in the standalone Settings window, which never activates the workbench diff viewer, and the settings feature does not import the VCS feature. Co-authored-by: muutot <[email protected]>
27 рядки
1.1 KiB
TypeScript
27 рядки
1.1 KiB
TypeScript
import { tx } from "@/platform/i18n";
|
||
import { lazyComponent } from "@/ui";
|
||
import { registerEditorKind, registerSettingsPage } from "@/workbench/contributions";
|
||
import { MERGE_SCHEME_PREVIEW_KIND } from "./mergeSchemePreviewKind";
|
||
|
||
/** Settings › Version Control › Log (also used by the Settings window). */
|
||
export function activateSettingsPages(): () => void {
|
||
// The three-pane merge preview of Color Scheme › Diff & Merge: registered here so the
|
||
// native Settings window has it too, where the workbench's diff viewer never activates.
|
||
const schemePreview = registerEditorKind({
|
||
kind: MERGE_SCHEME_PREVIEW_KIND,
|
||
component: lazyComponent(() => import("./MergeSchemePreview").then((m) => m.MergeSchemePreview)),
|
||
title: () => tx("Diff & Merge"),
|
||
});
|
||
const log = registerSettingsPage({
|
||
id: "vcs.log",
|
||
title: "Log",
|
||
order: 6,
|
||
keywords: ["git log", "references", "tags", "columns", "commit time"],
|
||
component: lazyComponent(() => import("./LogSettingsPage").then((m) => m.LogSettingsPage)),
|
||
});
|
||
return () => {
|
||
schemePreview();
|
||
log();
|
||
};
|
||
}
|