Skip to content

Commit d49ebe6

Browse files
authored
reveal next file when keep/undoing last hunk (microsoft#250821)
1 parent 507316d commit d49ebe6

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,12 +251,20 @@ abstract class AcceptRejectHunkAction extends ChatEditingEditorAction {
251251
);
252252
}
253253

254-
override async runChatEditingCommand(_accessor: ServicesAccessor, _session: IChatEditingSession, _entry: IModifiedFileEntry, ctrl: IModifiedFileEntryEditorIntegration, ...args: any[]): Promise<void> {
254+
override async runChatEditingCommand(accessor: ServicesAccessor, session: IChatEditingSession, entry: IModifiedFileEntry, ctrl: IModifiedFileEntryEditorIntegration, ...args: any[]): Promise<void> {
255+
256+
const instaService = accessor.get(IInstantiationService);
257+
255258
if (this._accept) {
256259
await ctrl.acceptNearestChange(args[0]);
257260
} else {
258261
await ctrl.rejectNearestChange(args[0]);
259262
}
263+
264+
if (entry.changesCount.get() === 0) {
265+
// no more changes, move to next file
266+
await instaService.invokeFunction(openNextOrPreviousChange, session, entry, true);
267+
}
260268
}
261269
}
262270

0 commit comments

Comments
 (0)