Skip to content

Commit 3c4a743

Browse files
authored
Fix insert generated cell location (microsoft#202607)
1 parent f58d7ff commit 3c4a743

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/vs/workbench/contrib/notebook/browser/view/cellParts/chat/cellChatActions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ registerAction2(class extends NotebookAction {
479479
return undefined;
480480
}
481481

482-
const cell = firstArg.index === 0 ? undefined : notebookEditor.cellAt(firstArg.index);
482+
const cell = firstArg.index <= 0 ? undefined : notebookEditor.cellAt(firstArg.index - 1);
483483

484484
return {
485485
cell,
@@ -496,7 +496,7 @@ registerAction2(class extends NotebookAction {
496496
const languageService = accessor.get(ILanguageService);
497497
newCell = insertCell(languageService, context.notebookEditor, 0, CellKind.Code, 'above', undefined, true);
498498
} else {
499-
newCell = insertNewCell(accessor, context, CellKind.Code, 'above', true);
499+
newCell = insertNewCell(accessor, context, CellKind.Code, 'below', true);
500500
}
501501

502502
if (!newCell) {

0 commit comments

Comments
 (0)