public static void AppendTaggedText(this StyledText markup, ColorScheme theme, IEnumerable <TaggedText> text, int col, int maxColumn) { foreach (var part in text) { if (part.Tag == TextTags.LineBreak) { markup.AppendLine(); col = 0; continue; } if (maxColumn >= 0 && col + part.Text.Length > maxColumn) { markup.AppendLine(part.Text, part.Tag != TextTags.Text ? GetThemeColor(theme, part.Tag) : null); //AppendAndBreakText(markup, part.Text, col, maxColumn); col = 0; } else { markup.Append(part.Text); var lineBreak = part.Text.LastIndexOfAny(new[] { '\n', '\r' }); if (lineBreak >= 0) { col += part.Text.Length - lineBreak; } else { col += part.Text.Length; } } } }
public static void AppendTaggedText(this StyledText markup, ColorScheme theme, IEnumerable <TaggedText> text) { foreach (var part in text) { if (part.Tag == TextTags.LineBreak) { markup.AppendLine(); continue; } markup.Append(part.Text, part.Tag != TextTags.Text ? GetThemeColor(theme, part.Tag) : null); } }