void ExtendSelection(SimpleSegment currentSeg)
{
if (currentSeg.Offset < selectionStart.Offset) {
textArea.Caret.Offset = currentSeg.Offset;
textArea.Selection = new SimpleSelection(currentSeg.Offset, selectionStart.Offset + selectionStart.Length);
} else {
textArea.Caret.Offset = currentSeg.Offset + currentSeg.Length;
textArea.Selection = new SimpleSelection(selectionStart.Offset, currentSeg.Offset + currentSeg.Length);
}
}