EonaCat.Editor 0.0.2

Prefix Reserved
dotnet add package EonaCat.Editor --version 0.0.2
                    
NuGet\Install-Package EonaCat.Editor -Version 0.0.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="EonaCat.Editor" Version="0.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="EonaCat.Editor" Version="0.0.2" />
                    
Directory.Packages.props
<PackageReference Include="EonaCat.Editor" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add EonaCat.Editor --version 0.0.2
                    
#r "nuget: EonaCat.Editor, 0.0.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package EonaCat.Editor@0.0.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=EonaCat.Editor&version=0.0.2
                    
Install as a Cake Addin
#tool nuget:?package=EonaCat.Editor&version=0.0.2
                    
Install as a Cake Tool

EonaCat.Editor

A modern, lightweight, and highly extensible WPF text editor control for .NET applications.

EonaCat.Editor provides a fast editing experience with syntax highlighting, code completion, snippets, search, undo/redo, and a powerful document model, making it suitable for IDEs, scripting tools, configuration editors, and code editing applications.

Features

  • 🚀 Fast WPF rendering engine
  • 🎨 Syntax highlighting
  • 💡 IntelliSense-style code completion
  • 📝 Snippet support
  • 🔍 Built-in search panel
  • â†Šī¸ Unlimited Undo / Redo
  • 📑 Line numbers
  • âœ‚ī¸ Clipboard operations
  • đŸŽ¯ Caret API
  • 📐 Selection API
  • 📄 TextDocument model
  • 📜 Scroll position API
  • 🔤 Word wrapping
  • 🎛 Fully customizable through WPF styling
  • ⚡ Optimized for large documents

Installation

Install from NuGet.

Package Manager

Install-Package EonaCat.Editor

.NET CLI

dotnet add package EonaCat.Editor

Quick Start

Add the namespace

xmlns:editor="clr-namespace:EonaCat.Editor.Core;assembly=EonaCat.Editor"

Add the editor

<Grid>

    <editor:TextEditor
        x:Name="Editor"
        FontFamily="Consolas"
        FontSize="14"
        ShowLineNumbers="True"
        VerticalScrollBarVisibility="Auto"
        HorizontalScrollBarVisibility="Auto"/>

</Grid>

Loading Text

Editor.Text = File.ReadAllText("Program.cs");

Saving Text

File.WriteAllText("Program.cs", Editor.Text);

Using a TextDocument

The editor stores all text inside a TextDocument.

Create a document:

var document = new TextDocument();

document.Text = "Hello World";

Editor.Document = document;

Read the current document:

string text = Editor.Document.Text;

Basic Properties

Text

Editor.Text = "Hello World";

string current = Editor.Text;

Read Only

Editor.IsReadOnly = true;

Word Wrap

Editor.WordWrap = true;

Show Line Numbers

Editor.ShowLineNumbers = true;

Font

<editor:TextEditor

    FontFamily="Consolas"
    FontSize="14"/>

Line Number Color

Editor.LineNumbersForeground = Brushes.Gray;

Undo / Redo

if (Editor.CanUndo)
{
    Editor.Undo();
}

if (Editor.CanRedo)
{
    Editor.Redo();
}

Caret

Move the caret.

Editor.CaretOffset = 0;

Read the current position.

int position = Editor.CaretOffset;

Selection

Read the selected text.

string text = Editor.SelectedText;

Select text.

Editor.SelectionStart = 50;
Editor.SelectionLength = 20;

Scrolling

double vertical = Editor.VerticalOffset;
double horizontal = Editor.HorizontalOffset;

Viewport size.

double width = Editor.ViewportWidth;
double height = Editor.ViewportHeight;

Syntax Highlighting

Assign a highlighting definition.

Editor.SyntaxHighlighting = myHighlightingDefinition;

You can create custom highlighting definitions for your own languages.

The built-in search panel supports:

  • Find
  • Find Next
  • Find Previous
  • Match Case
  • Whole Word
  • Regular Expressions
  • Highlight All

Example:

SearchPanel.Install(Editor.TextArea);

Code Completion

Show an IntelliSense completion window.

var completionWindow = new CompletionWindow(Editor.TextArea);

completionWindow.CompletionList.CompletionData.Add(
    new MyCompletionData("Console"));

completionWindow.Show();

The completion system supports:

  • Keyboard navigation
  • Icons
  • Descriptions
  • Automatic insertion
  • Custom completion providers

Snippets

Insert reusable code templates.

Example features:

  • Editable placeholders
  • Caret positioning
  • Bound fields
  • Replaceable regions
  • Selection support

Snippets can be created and inserted programmatically using the included snippet APIs.

Mouse Hover

Useful for tooltips and quick info.

Editor.MouseHover += Editor_MouseHover;
Editor.MouseHoverStopped += Editor_MouseHoverStopped;

Document Information

Determine whether the document has changed.

bool modified = Editor.IsModified;

Retrieve the number of lines.

int lines = Editor.LineCount;

Current encoding.

Encoding encoding = Editor.Encoding;

Styling

Since the editor is a normal WPF control, it fully supports:

  • Styles
  • Control Templates
  • Resource Dictionaries
  • Dynamic Resources
  • Themes

Example:

<Style TargetType="editor:TextEditor">

    <Setter Property="Background"
            Value="#1E1E1E"/>

    <Setter Property="Foreground"
            Value="White"/>

</Style>

Complete Example

XAML

<Window
    x:Class="Sample.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:editor="clr-namespace:EonaCat.Editor.Core;assembly=EonaCat.Editor">

    <Grid>

        <editor:TextEditor
            x:Name="Editor"
            FontFamily="Consolas"
            FontSize="14"
            ShowLineNumbers="True"
            WordWrap="False"
            VerticalScrollBarVisibility="Auto"
            HorizontalScrollBarVisibility="Auto"/>

    </Grid>

</Window>

Code Behind

using System.Windows;

namespace Sample
{
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();

            Editor.Text =
@"using System;

Console.WriteLine(""Hello World!"");";
        }
    }
}

Included Components

The package includes:

  • TextEditor
  • TextDocument
  • Search Panel
  • Completion Window
  • Completion List
  • Insight Window
  • Snippet Engine
  • Syntax Highlighting Engine
  • Rendering Engine
  • Undo / Redo Manager

Typical Use Cases

EonaCat.Editor is ideal for:

  • Source code editors
  • IDEs
  • Script editors
  • JSON editors
  • XML editors
  • SQL editors
  • Markdown editors
  • Configuration editors
  • Log viewers
  • Custom programming languages

Supported Frameworks

  • .NET Framework 4.8
  • .NET 6 Windows
Product Compatible and additional computed target framework versions.
.NET net6.0-windows7.0 is compatible.  net7.0-windows was computed.  net8.0-windows was computed.  net9.0-windows was computed.  net10.0-windows was computed. 
.NET Framework net48 is compatible.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETFramework 4.8

    • No dependencies.
  • net6.0-windows7.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on EonaCat.Editor:

Package Downloads
EonaCat.MarkdownEditor

A feature-rich Markdown-to-FlowDocument rendering engine and WPF viewer control for .NET.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.0.2 142 7/4/2026
0.0.1 112 7/4/2026