anchor.diff:    void trackCursorPosition(int start) {
       insertPos = start + _updatedText.length;
     }
  +
  +  @override
  +  ngOnChanges(Map<String, SimpleChange> changes) {
  +    TextareaSelection selInfo = _textareaDomService.getCurrentSelectionInfo();
  +    insertPos = selInfo.start;
  +  }
   }
positive.code:   List<String> _undoList = new List<String>();
  
    int insertPos = -1;
  
    final TextProcessingService _textProcessingService;
    final TextareaDomService _textareaDomService;
  
    ReplaceDialogComponent(this._textProcessingService,
        this._textareaDomService);
  
negative.code:     selector: 'replace-dialog',
      templateUrl: 'replace_component.html',
      providers: const [TextProcessingService, TextareaDomService])
  class ReplaceDialogComponent implements OnChanges {
  
    final TextProcessingService _textProcessingService;
    final TextareaDomService _textareaDomService;
  
    @Input()
    bool showDialog = false;
  