feat(vcs): Accept a diff change from the keyboard and step between diff files (#158)

- Accept Left Side / Accept Right Side copy the change at the caret to the
  other side of a side-by-side diff (⌃⌘→ / ⌃⌘← on macOS, Ctrl+Alt+R /
  Ctrl+Alt+A on Windows).
- Compare Next File / Compare Previous File open the neighbouring file of
  the diff chain directly (⌃⇧→ / ⌃⇧← on macOS, Alt+Shift+→ / ← on Windows).
Цей коміт міститься в:
l0ng-ai authored and GitHub committed 2026-10-29 01:38:22 +08:00
1 джерело cfd2970531
коміт b35035f8d9
9 files changed
+80 -7

No files matched your search

+1 -1
Переглянути файл
@@ -84,7 +84,7 @@ class RevertWidget extends WidgetType {
}
}
function chunkAt(chunks: readonly Chunk[], side: "a" | "b", pos: number, docLength: number): number {
export function chunkAt(chunks: readonly Chunk[], side: "a" | "b", pos: number, docLength: number): number {
return chunks.findIndex((c) => {
const [from, to] = side === "a" ? [c.fromA, c.toA] : [c.fromB, c.toB];
return from === to ? pos === from : pos >= from && pos < Math.max(to, from + 1) && pos <= docLength;