Skip to content

Commit 1b1e2a2

Browse files
authored
Add previously selected kernel to MRU on switching. (microsoft#166662)
1 parent c1fa325 commit 1b1e2a2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/vs/workbench/contrib/notebook/browser/viewParts/notebookKernelQuickPickStrategy.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -638,6 +638,11 @@ export class KernelPickerMRUStrategy extends KernelPickerStrategyBase {
638638
}
639639

640640
protected override _selecteKernel(notebook: NotebookTextModel, kernel: INotebookKernel): void {
641+
const currentInfo = this._notebookKernelService.getMatchingKernel(notebook);
642+
if (currentInfo.selected) {
643+
// there is already a selected kernel
644+
this._notebookKernelHistoryService.addMostRecentKernel(currentInfo.selected);
645+
}
641646
super._selecteKernel(notebook, kernel);
642647
this._notebookKernelHistoryService.addMostRecentKernel(kernel);
643648
}

0 commit comments

Comments
 (0)