File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
src/vs/workbench/contrib/inlineChat/browser Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -308,10 +308,16 @@ export class InlineChatController implements IEditorContribution {
308
308
this . _zone . value . widget . preferredExpansionState = this . _activeSession . lastExpansionState ;
309
309
this . _zone . value . widget . value = this . _activeSession . lastInput ?. value ?? this . _zone . value . widget . value ;
310
310
this . _zone . value . widget . onDidChangeInput ( _ => {
311
- const pos = this . _zone . value . position ;
312
- if ( pos && this . _zone . value . widget . hasFocus ( ) && this . _zone . value . widget . value ) {
313
- this . _editor . revealPosition ( pos , ScrollType . Smooth ) ;
311
+ const start = this . _zone . value . position ;
312
+ if ( ! start || ! this . _zone . value . widget . hasFocus ( ) || ! this . _zone . value . widget . value || ! this . _editor . hasModel ( ) ) {
313
+ return ;
314
+ }
315
+ const nextLine = start . lineNumber + 1 ;
316
+ if ( nextLine >= this . _editor . getModel ( ) . getLineCount ( ) ) {
317
+ // last line isn't supported
318
+ return ;
314
319
}
320
+ this . _editor . revealLine ( nextLine , ScrollType . Smooth ) ;
315
321
} ) ;
316
322
317
323
this . _showWidget ( true , options . position ) ;
You can’t perform that action at this time.
0 commit comments