public TextChange(TextChange change, ITextProvider oldText, ITextProvider newText)
            : this() {
            this.Combine(change);

            OldText = oldText;
            NewText = newText;
        }
        public void Combine(TextChange other) {
            if (other.IsEmpty())
                return;

            if (OldRange == TextRange.EmptyRange || NewRange == TextRange.EmptyRange) {
                OldRange = other.OldRange;
                NewRange = other.NewRange;
            } else {
                int oldStart = Math.Min(other.OldRange.Start, this.OldRange.Start);
                int oldEnd = Math.Max(other.OldRange.End, this.OldRange.End);

                int newStart = Math.Min(other.NewRange.Start, this.NewRange.Start);
                int newEnd = Math.Max(other.NewRange.End, this.NewRange.End);

                this.OldRange = new TextRange(oldStart, oldEnd);
                this.NewRange = new TextRange(newStart, newEnd);
            }

            Version = Math.Max(this.Version, other.Version);
        }