Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Close editor on successful action, not any change
  • Loading branch information
colin-grant-work committed Mar 26, 2025
commit 118daf9008c6122280295f15cf9f3cd4d6e90e35
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ export class DirtyDiffController implements Disposable {

handleDirtyDiffUpdate(dirtyDiff: DirtyDiffUpdate): void {
if (dirtyDiff.editor === this.editor) {
this.closeWidget();
this.dirtyDiff = dirtyDiff;
}
}
Expand Down
4 changes: 3 additions & 1 deletion packages/scm/src/browser/dirty-diff/dirty-diff-widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,10 @@ class DirtyDiffPeekView extends MonacoEditorPeekViewWidget {
if (item instanceof ActionMenuNode) {
const { command, id, label, icon, when } = item;
if (icon && menuCommandExecutor.isVisible(menuPath, command, this.widget) && (!when || contextKeyService.match(when))) {
// Close editor on successful contributed action.
// https://github.com/microsoft/vscode/blob/11b1500e0a2e8b5ba12e98a3905f9d120b8646a0/src/vs/workbench/contrib/scm/browser/quickDiffWidget.ts#L356-L361
this.addAction(id, label, icon, menuCommandExecutor.isEnabled(menuPath, command, this.widget), () => {
menuCommandExecutor.executeCommand(menuPath, command, this.widget);
menuCommandExecutor.executeCommand(menuPath, command, this.widget).then(() => this.dispose());
});
}
}
Expand Down