public static bool TryMoveForward(ref TextCaret caret) { TextCaret maybe = caret.GetNextPosition(); if (maybe.IsValid) { caret = maybe; return(true); } return(false); }
public static TextCaret MoveCursorForwardBy(this TextCaret cursor, int index) { int i = index; while (i > 0) { cursor = cursor.GetNextPosition(); i -= 1; } return(cursor); }