AvalonStudio.TextEditor.Document.TextChangeEventArgs.GetNewOffset C# (CSharp) Method

GetNewOffset() public method

Gets the new offset where the specified offset moves after this document change.
public GetNewOffset ( int offset, AnchorMovementType movementType = AnchorMovementType.Default ) : int
offset int
movementType AnchorMovementType
return int
		public virtual int GetNewOffset(int offset, AnchorMovementType movementType = AnchorMovementType.Default)
		{
			if (offset >= Offset && offset <= Offset + RemovalLength)
			{
				if (movementType == AnchorMovementType.BeforeInsertion)
					return Offset;
				return Offset + InsertionLength;
			}
			if (offset > Offset)
			{
				return offset + InsertionLength - RemovalLength;
			}
			return offset;
		}