File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
src/vs/workbench/contrib/notebook/browser/controller/chat Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -382,6 +382,7 @@ registerAction2(class extends NotebookAction {
382382 }
383383 ]
384384 } ,
385+ f1 : false ,
385386 menu : [
386387 {
387388 id : MenuId . NotebookCellBetween ,
@@ -454,6 +455,7 @@ registerAction2(class extends NotebookAction {
454455 original : '$(sparkle) Generate' ,
455456 } ,
456457 tooltip : localize ( 'notebookActions.menu.insertCodeCellWithChat.tooltip' , "Generate Code Cell with Chat" ) ,
458+ f1 : false ,
457459 menu : [
458460 {
459461 id : MenuId . NotebookCellListTop ,
Original file line number Diff line number Diff line change @@ -369,7 +369,7 @@ export class NotebookChatController extends Disposable implements INotebookEdito
369369 const cellTop = this . _notebookEditor . getAbsoluteTopOfElement ( previousCell ) ;
370370 const cellHeight = this . _notebookEditor . getHeightOfElement ( previousCell ) ;
371371
372- this . _notebookEditor . revealOffsetInCenterIfOutsideViewport ( cellTop + cellHeight ) ;
372+ this . _notebookEditor . revealOffsetInCenterIfOutsideViewport ( cellTop + cellHeight + 48 /** center of the dialog */ ) ;
373373 }
374374 }
375375 }
@@ -412,6 +412,12 @@ export class NotebookChatController extends Disposable implements INotebookEdito
412412 return ;
413413 }
414414
415+ if ( this . _widget . editingCell && this . _widget . editingCell . textBuffer . getLength ( ) > 0 ) {
416+ // it already contains some text, clear it
417+ const ref = await this . _widget . editingCell . resolveTextModel ( ) ;
418+ ref . setValue ( '' ) ;
419+ }
420+
415421 const editingCellIndex = this . _widget . editingCell ? this . _notebookEditor . getCellIndex ( this . _widget . editingCell ) : undefined ;
416422 if ( editingCellIndex !== undefined ) {
417423 this . _notebookEditor . setSelections ( [ {
You can’t perform that action at this time.
0 commit comments