public static void LoadFromString(this ITextDocument document, string text)
        {
            string trimmed = text.Equals("\r") ? string.Empty : text;

            document.SetText(TextSetOptions.None, trimmed);

            document.ClearUndoHistory();
        }