mirror of
https://github.com/l0ng-ai/openidea.git
synced 2026-11-24 16:04:21 +00:00
- Settings › Tools › External Diff Tools: a program and its parameters (%1 the left file, %2 the right file, %3 the title). Diff viewers then offer Show Diff in External Tool (toolbar button and action). Saved files are passed as they are (saved first); revisions and texts go to temporary files named after the file. The program is always read from the global settings, never a project's, and runs on this machine. - Show Diff for Lines (vcs.showDiffForLines): with the caret on changed lines in the editor, opens the file's diff at that line.
35 lines
1.4 KiB
TypeScript
35 lines
1.4 KiB
TypeScript
/** The focused diff editor's chunk navigation, for actions that must not load the diff editor. */
|
|
import type { DiffViewerHost } from "./diffViewerProviders";
|
|
|
|
export interface DiffNavigator {
|
|
next(): void;
|
|
prev(): void;
|
|
jumpToSource(): void;
|
|
/** Apply the change at the caret from the left side to the right (`a`) or back (`b`). */
|
|
applyChange(source: "a" | "b"): boolean;
|
|
/** Open the next / previous file of the diff chain (changes of a commit or change list). */
|
|
file(dir: 1 | -1): void;
|
|
/** The viewer's settings as a popup menu (⇧⌘D). */
|
|
showSettings(): void;
|
|
/** IDEA's Select Opposite Diff Pane: focus the other side of a side-by-side diff; false when there is none. */
|
|
focusOpposite(): boolean;
|
|
/** IDEA's Close Diff Editor (Esc): closes the diff's editor tab; false when the diff isn't one. */
|
|
close(): boolean;
|
|
/** Swap Sides of a diff whose sides the user picked; false when it has none to swap. */
|
|
swapSides(): boolean;
|
|
/** Show Diff in External Tool; false when none is set up. */
|
|
showInExternalTool(): boolean;
|
|
/** The built panes, for diff viewer contributions' actions (null while loading). */
|
|
viewer?(): DiffViewerHost | null;
|
|
}
|
|
|
|
let focused: DiffNavigator | null = null;
|
|
|
|
export function focusedDiffNavigator(): DiffNavigator | null {
|
|
return focused;
|
|
}
|
|
|
|
export function setFocusedDiffNavigator(nav: DiffNavigator | null) {
|
|
focused = nav;
|
|
}
|