Basic Syntax highlighting, added CodeTextBox to MainWindow to test it.

This commit is contained in:
David
2016-10-13 21:08:34 -04:00
parent 071b63f01d
commit 1c44e00a1d
7 changed files with 137 additions and 17 deletions

View File

@@ -0,0 +1,14 @@
using System.Windows.Documents;
using Befunge.Editor.CharStyles;
namespace Befunge.Editor.Utils
{
internal static class Extensions
{
public static void AppendStylizedText(this Paragraph p, ITextStyler styler, char text)
=> AppendStylizedText(p, styler, text.ToString());
public static void AppendStylizedText(this Paragraph p, ITextStyler styler, string text)
=> p.Inlines.AddRange(styler?.StyledString(text) ?? new[] {new Run(text)});
}
}