|
|
@@ -122,7 +122,7 @@ export class DiffViewProvider {
|
|
|
}
|
|
|
|
|
|
// Place cursor at the beginning of the diff editor to keep it out of
|
|
|
- // the way of the stream animation.
|
|
|
+ // the way of the stream animation, but do this without stealing focus
|
|
|
const beginningOfDocument = new vscode.Position(0, 0)
|
|
|
diffEditor.selection = new vscode.Selection(beginningOfDocument, beginningOfDocument)
|
|
|
|
|
|
@@ -137,7 +137,7 @@ export class DiffViewProvider {
|
|
|
// Update decorations.
|
|
|
this.activeLineController.setActiveLine(endLine)
|
|
|
this.fadedOverlayController.updateOverlayAfterLine(endLine, document.lineCount)
|
|
|
- // Scroll to the current line.
|
|
|
+ // Scroll to the current line without stealing focus.
|
|
|
const ranges = this.activeDiffEditor?.visibleRanges
|
|
|
if (ranges && ranges.length > 0 && ranges[0].start.line < endLine && ranges[0].end.line > endLine) {
|
|
|
this.scrollEditorToLine(endLine)
|
|
|
@@ -504,7 +504,7 @@ export class DiffViewProvider {
|
|
|
// Pre-open the file as a text document to ensure it doesn't open in preview mode
|
|
|
// This fixes issues with files that have custom editor associations (like markdown preview)
|
|
|
vscode.window
|
|
|
- .showTextDocument(uri, { preview: false, viewColumn: vscode.ViewColumn.Active })
|
|
|
+ .showTextDocument(uri, { preview: false, viewColumn: vscode.ViewColumn.Active, preserveFocus: true })
|
|
|
.then(() => {
|
|
|
// Execute the diff command after ensuring the file is open as text
|
|
|
return vscode.commands.executeCommand(
|
|
|
@@ -552,7 +552,7 @@ export class DiffViewProvider {
|
|
|
|
|
|
for (const part of diffs) {
|
|
|
if (part.added || part.removed) {
|
|
|
- // Found the first diff, scroll to it.
|
|
|
+ // Found the first diff, scroll to it without stealing focus.
|
|
|
this.activeDiffEditor.revealRange(
|
|
|
new vscode.Range(lineCount, 0, lineCount, 0),
|
|
|
vscode.TextEditorRevealType.InCenter,
|