Skip to content

Commit

Permalink
Only save current value when navigated to the end (#240972)
Browse files Browse the repository at this point in the history
So if you navigated up, then saveState happened, it doesn't overwrite the last value in history
Fix microsoft/vscode-copilot-release#3750
  • Loading branch information
roblourens authored Feb 17, 2025
1 parent e031e00 commit ee1d886
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/vs/workbench/contrib/chat/browser/chatInputPart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1500,7 +1500,10 @@ export class ChatInputPart extends Disposable implements IHistoryNavigationWidge
}

saveState(): void {
this.saveCurrentValue(this.getInputState());
if (this.history.isAtEnd()) {
this.saveCurrentValue(this.getInputState());
}

const inputHistory = [...this.history];
this.historyService.saveHistory(this.location, inputHistory);
}
Expand Down

0 comments on commit ee1d886

Please sign in to comment.