From 15006ee21fcb7b346cff59293d3c5165ad538f63 Mon Sep 17 00:00:00 2001 From: Ladislau Szomoru <3372902+lszomoru@users.noreply.github.com> Date: Tue, 21 Jan 2025 16:14:57 +0100 Subject: [PATCH] Git - when doing a git rename close the old file and open the new one (#238368) --- extensions/git/src/commands.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/extensions/git/src/commands.ts b/extensions/git/src/commands.ts index 01b9ef29fea..abb00af22ba 100644 --- a/extensions/git/src/commands.ts +++ b/extensions/git/src/commands.ts @@ -1341,6 +1341,10 @@ export class CommandCenter { } await repository.move(from, to); + + // Close active editor and open the renamed file + await commands.executeCommand('workbench.action.closeActiveEditor'); + await commands.executeCommand('vscode.open', Uri.file(path.join(repository.root, to)), { viewColumn: ViewColumn.Active }); } @command('git.stage')