дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-11-08 19:02:17 +02:00
feat(vcs): IDEA-style synchronized scrolling for the side-by-side diff (#181)
The side-by-side diff gets two independent options. Synchronize Scrolling (toolbar lock, also in the settings menu, on by default) scrolls both panes together; Align Changes (settings menu, off by default) pads the panes so changes line up. With Align Changes off, the panes keep their own heights and a divider of curved bands joins each change, with arrows to apply it; scrolling one pane moves the other through the matching change (anchored at a third of the height), including caret moves and the wheel over the divider. Scroll mapping and the divider look up changes by binary search, so large files with thousands of changes scroll smoothly. Claude-Session: https://claude.ai/code/session_01Dq6jQQn8ZhRfkkyj3PRutA Co-authored-by: jaw52 <[email protected]>
Цей коміт міститься в:
10 files changed
+766
-36
No files matched your search
@@ -15,7 +15,13 @@ export interface DiffViewOptions {
|
||||
ignore: IgnorePolicy;
|
||||
highlight: HighlightPolicy;
|
||||
collapse: boolean;
|
||||
/** Side-by-side panes scroll together. */
|
||||
syncScroll: boolean;
|
||||
/**
|
||||
* Side-by-side panes are padded so that unchanged lines line up. Off, each pane
|
||||
* keeps its own height and a curved divider joins the changes (IDEA's default).
|
||||
*/
|
||||
alignChanges: boolean;
|
||||
}
|
||||
|
||||
export const IGNORE_OPTIONS: ReadonlyArray<{ value: IgnorePolicy; label: string }> = [
|
||||
@@ -37,6 +43,7 @@ export const DEFAULT_DIFF_OPTIONS: DiffViewOptions = {
|
||||
highlight: "words",
|
||||
collapse: true,
|
||||
syncScroll: true,
|
||||
alignChanges: false,
|
||||
};
|
||||
|
||||
const KEY = "openidea.vcs.diffOptions";
|
||||
@@ -54,6 +61,7 @@ export function parseDiffOptions(raw: unknown): DiffViewOptions {
|
||||
highlight: oneOf(o.highlight, HIGHLIGHT_OPTIONS, d.highlight),
|
||||
collapse: typeof o.collapse === "boolean" ? o.collapse : d.collapse,
|
||||
syncScroll: typeof o.syncScroll === "boolean" ? o.syncScroll : d.syncScroll,
|
||||
alignChanges: typeof o.alignChanges === "boolean" ? o.alignChanges : d.alignChanges,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Заблокувати користувача