/// <summary> /// Creates a new AnchorSegment that creates new anchors. /// </summary> public RenameSegment(TextDocument document, int offset, int length) { _start = document?.CreateAnchor(offset) ?? throw new ArgumentNullException(nameof(document)); _start.SurviveDeletion = true; _start.MovementType = AnchorMovementType.BeforeInsertion; _end = document.CreateAnchor(offset + length); _end.SurviveDeletion = true; _end.MovementType = AnchorMovementType.AfterInsertion; }
public ITextAnchor CreateAnchor(int offset) { return(new AnchorAdapter(document.CreateAnchor(offset))); }