@@ -758,29 +758,29 @@ export class InlineChatController implements IEditorContribution {
758758 let newPosition : Position | undefined ;
759759
760760 if ( response . result ?. errorDetails ) {
761- //
761+ // error -> no message, errors are shown with the request
762762
763763 } else if ( response . response . value . length === 0 ) {
764764 // empty -> show message
765765 const status = localize ( 'empty' , "No results, please refine your input and try again" ) ;
766766 this . _ui . value . zone . widget . updateStatus ( status , { classes : [ 'warn' ] } ) ;
767767
768768 } else {
769- // real response -> complex...
769+ // real response -> no message
770770 this . _ui . value . zone . widget . updateStatus ( '' ) ;
771+ }
771772
772- const position = await this . _strategy . renderChanges ( ) ;
773- if ( position ) {
774- // if the selection doesn't start far off we keep the widget at its current position
775- // because it makes reading this nicer
776- const selection = this . _editor . getSelection ( ) ;
777- if ( selection ?. containsPosition ( position ) ) {
778- if ( position . lineNumber - selection . startLineNumber > 8 ) {
779- newPosition = position ;
780- }
781- } else {
773+ const position = await this . _strategy . renderChanges ( ) ;
774+ if ( position ) {
775+ // if the selection doesn't start far off we keep the widget at its current position
776+ // because it makes reading this nicer
777+ const selection = this . _editor . getSelection ( ) ;
778+ if ( selection ?. containsPosition ( position ) ) {
779+ if ( position . lineNumber - selection . startLineNumber > 8 ) {
782780 newPosition = position ;
783781 }
782+ } else {
783+ newPosition = position ;
784784 }
785785 }
786786 this . _showWidget ( this . _session . headless , false , newPosition ) ;
0 commit comments