public void DoFormatSelection(TextSpanStyle textStyle)
{
int startLineNum = textLineWriter.LineNumber;
int startCharIndex = textLineWriter.CharIndex;
SplitSelectedText();
VisualSelectionRange selRange = SelectionRange;
if (selRange != null)
{
foreach (EditableRun r in selRange.GetPrintableTextRunIter())
{
r.SetStyle(textStyle);
}
this.updateJustCurrentLine = selectionRange.IsOnTheSameLine;
CancelSelect();
CharIndex++;
CharIndex--;
}
}