private static MeasuredRectangle MeasureBackward(TextCaret caret, ITextCaretMeasurer measurer)
        {
            if (caret.IsAtBlockStart || caret.Block?.Tag == null)
            {
                return(MeasuredRectangle.Invalid);
            }

            return(measurer.MeasureTextPosition(caret.GetPreviousPosition()));
        }
        private static MeasuredRectangle MeasureForward(TextCaret caret, ITextCaretMeasurer measurer)
        {
            if (caret.IsAtBlockEnd || caret.Block?.Tag == null)
            {
                Debug.Assert(!caret.IsAtBlockEnd, "This usually indicates an error");
                return(MeasuredRectangle.Invalid);
            }

            return(measurer.MeasureTextPosition(caret));
        }