File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
src/vs/workbench/contrib/chat/browser/contrib Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ export class ChatDynamicVariableModel extends Disposable implements IChatWidgetC
5050 this . _register ( widget . inputEditor . onDidChangeModelContent ( e => {
5151 e . changes . forEach ( c => {
5252 // Don't mutate entries in _variables, since they will be returned from the getter
53- const originalNumVariables = this . _variables . length ;
53+ let didModifyState = false ;
5454 this . _variables = coalesce ( this . _variables . map ( ref => {
5555 const intersection = Range . intersectRanges ( ref . range , c . range ) ;
5656 if ( intersection && ! intersection . isEmpty ( ) ) {
@@ -63,9 +63,11 @@ export class ChatDynamicVariableModel extends Disposable implements IChatWidgetC
6363 text : '' ,
6464 } ] ) ;
6565 }
66+ didModifyState = true ;
6667 return null ;
6768 } else if ( Range . compareRangesUsingStarts ( ref . range , c . range ) > 0 ) {
6869 const delta = c . text . length - c . rangeLength ;
70+ didModifyState = true ;
6971 return {
7072 ...ref ,
7173 range : {
@@ -80,7 +82,7 @@ export class ChatDynamicVariableModel extends Disposable implements IChatWidgetC
8082 return ref ;
8183 } ) ) ;
8284
83- if ( this . _variables . length !== originalNumVariables ) {
85+ if ( didModifyState ) {
8486 this . _onDidChangeInputState . fire ( ) ;
8587 }
8688 } ) ;
You can’t perform that action at this time.
0 commit comments