@@ -437,7 +437,7 @@ export class MonacoEditor extends React.Component<IMonacoEditorProps, IMonacoEdi
437
437
438
438
public setValue ( text : string , cursorPos : CursorPos ) {
439
439
if ( this . state . model && this . state . editor && this . state . model . getValue ( ) !== text ) {
440
- this . forceValue ( text , cursorPos ) ;
440
+ this . forceValue ( text , cursorPos , true ) ;
441
441
}
442
442
}
443
443
@@ -469,19 +469,18 @@ export class MonacoEditor extends React.Component<IMonacoEditorProps, IMonacoEdi
469
469
}
470
470
}
471
471
472
- private forceValue ( text : string , cursorPos : CursorPos | monacoEditor . IPosition ) {
472
+ private forceValue ( text : string , cursorPos : CursorPos | monacoEditor . IPosition , allowNotifications ?: boolean ) {
473
473
if ( this . state . model && this . state . editor ) {
474
474
// Save current position. May need it to update after setting.
475
475
const current = this . state . editor . getPosition ( ) ;
476
476
477
- // Disable change notifications as we know this
478
- // is different.
479
- this . skipNotifications = true ;
477
+ // Disable change notifications if forcing this value should not allow them
478
+ this . skipNotifications = allowNotifications ? false : true ;
480
479
481
480
// Close any suggestions that are open
482
481
this . closeSuggestWidget ( ) ;
483
482
484
- // Change our text. This shouldn't fire an update to the model
483
+ // Change our text.
485
484
this . previousModelValue = text ;
486
485
this . state . model . setValue ( text ) ;
487
486
0 commit comments