@@ -59,6 +59,8 @@ export class ChatInputPart extends Disposable implements IHistoryNavigationWidge
59
59
private followupsDisposables = this . _register ( new DisposableStore ( ) ) ;
60
60
61
61
private _inputEditor ! : CodeEditorWidget ;
62
+ private _inputEditorElement ! : HTMLElement ;
63
+
62
64
public get inputEditor ( ) {
63
65
return this . _inputEditor ;
64
66
}
@@ -148,8 +150,14 @@ export class ChatInputPart extends Disposable implements IHistoryNavigationWidge
148
150
this . history . add ( editorValue ) ;
149
151
}
150
152
151
- this . _inputEditor . focus ( ) ;
153
+ const domNode = this . _inputEditor . getDomNode ( ) ;
154
+ if ( ! domNode ) {
155
+ return ;
156
+ }
157
+ this . _inputEditorElement . removeChild ( domNode ) ;
152
158
this . _inputEditor . setValue ( '' ) ;
159
+ this . _inputEditorElement . appendChild ( domNode ) ;
160
+ this . _inputEditor . focus ( ) ;
153
161
}
154
162
155
163
render ( container : HTMLElement , initialValue : string , widget : IChatWidget ) {
@@ -181,8 +189,8 @@ export class ChatInputPart extends Disposable implements IHistoryNavigationWidge
181
189
options . suggest = { showIcons : false } ;
182
190
options . scrollbar = { ...( options . scrollbar ?? { } ) , vertical : 'hidden' } ;
183
191
184
- const inputEditorElement = dom . append ( inputContainer , $ ( '.interactive-input-editor' ) ) ;
185
- this . _inputEditor = this . _register ( scopedInstantiationService . createInstance ( CodeEditorWidget , inputEditorElement , options , getSimpleCodeEditorWidgetOptions ( ) ) ) ;
192
+ this . _inputEditorElement = dom . append ( inputContainer , $ ( '.interactive-input-editor' ) ) ;
193
+ this . _inputEditor = this . _register ( scopedInstantiationService . createInstance ( CodeEditorWidget , this . _inputEditorElement , options , getSimpleCodeEditorWidgetOptions ( ) ) ) ;
186
194
187
195
this . _register ( this . _inputEditor . onDidChangeModelContent ( ( ) => {
188
196
const currentHeight = Math . min ( this . _inputEditor . getContentHeight ( ) , INPUT_EDITOR_MAX_HEIGHT ) ;
0 commit comments