WpfCodeEditor 0.9.6.6

dotnet add package WpfCodeEditor --version 0.9.6.6
                    
NuGet\Install-Package WpfCodeEditor -Version 0.9.6.6
                    
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="WpfCodeEditor" Version="0.9.6.6" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="WpfCodeEditor" Version="0.9.6.6" />
                    
Directory.Packages.props
<PackageReference Include="WpfCodeEditor" />
                    
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 WpfCodeEditor --version 0.9.6.6
                    
#r "nuget: WpfCodeEditor, 0.9.6.6"
                    
#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 WpfCodeEditor@0.9.6.6
                    
#: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=WpfCodeEditor&version=0.9.6.6
                    
Install as a Cake Addin
#tool nuget:?package=WpfCodeEditor&version=0.9.6.6
                    
Install as a Cake Tool

WpfCodeEditor

A full-featured WPF code editor UserControl for .NET 8. Built as part of the WpfHexEditorControl project.

dotnet add package WpfCodeEditor

What's New in 0.9.6.6

  • Fix: SmartComplete popup no longer steals keyboard focus. The suggestion list is non-focusable — caret blink and word-highlight timers are never interrupted. Up/Down/PageUp/PageDown/Home/End/Enter/Tab/Escape are forwarded from the editor to the popup.
  • Fix: CodeEditorSplitHost — IDE docking focus (Focus() on the Grid container) is correctly routed to the active editor via OnGotKeyboardFocus. Secondary editor ModifiedChanged is now wired. IsDirty, Save, and SaveAsync always delegate to the primary editor (which owns the file path).
  • Fix: Word-highlight feedback loop eliminated — cursor position is tracked before InvalidateRegion, preventing a second 250ms debounce cycle from firing on every arrow-key press.
  • Fix: Arrow-key navigation now triggers NotifyCursorMoved() so word-highlight updates without waiting for the next render frame.
  • Fix: Save guard — writing an empty buffer over a non-empty file on disk is blocked with a status message (prevents data loss from timing races during OpenAsync).
  • Fix: LSP burst-init dispatcher calls downgraded to DispatcherPriority.Background so Roslyn workspace startup does not block WPF frame rendering.
  • New: EnableWordHighlight setting — toggle occurrence highlighting via the Code Editor options page or CodeEditorDefaultSettings.EnableWordHighlight.

What's New in 0.9.6.5

  • Fix: LSP inlay hints and declaration hints (code lens) no longer render as ghost overlays on top of code text. Hints now correctly align with the text area origin, accounting for gutter offset, top margin, and horizontal scroll.
  • Fix: ReadOnly mode no longer blocks text selection and caret placement. Only text modification is blocked — selection (Shift+Arrow, drag), caret click, copy (Ctrl+C), and select all (Ctrl+A) now work as expected.

Quick Start

<Window xmlns:ce="clr-namespace:WpfHexEditor.Editor.CodeEditor.Controls;assembly=WpfHexEditor.Editor.CodeEditor">
    <ce:CodeEditorSplitHost x:Name="Editor" />
</Window>
// Load a file
Editor.PrimaryEditor.LoadText(File.ReadAllText("Program.cs"));
Editor.SetLanguage(languageDefinition);

TextEditor (lightweight, plain text)

<Window xmlns:te="clr-namespace:WpfHexEditor.Editor.TextEditor;assembly=WpfHexEditor.Editor.TextEditor">
    <te:TextEditor x:Name="TextEdit" />
</Window>
// Load plain text
TextEdit.LoadText(File.ReadAllText("notes.txt"));

// Read back
string content = TextEdit.Text;

The TextEditor control is a lightweight plain-text editor included in the package. Use CodeEditorSplitHost when you need syntax highlighting, folding, and LSP support.

Features

Editing

  • Multi-caret editing with Ctrl+Click
  • Smart auto-complete with context-aware suggestions
  • Code snippets with tab expansion
  • Block selection (Alt+Drag)
  • Auto-indent and smart brace matching
  • Undo/redo with coalescence

Syntax & Languages

  • 400+ language definitions via .whfmt format
  • Syntax highlighting with customizable themes
  • Code folding (regions, braces, tags)
  • End-of-block hover hints
  • Line numbers with configurable gutter
  • Minimap overview
  • Go to line (Ctrl+G)
  • Breadcrumb navigation bar
  • Bookmark support
  • Find and replace with regex support
  • Search highlighting across document
  • Match case / whole word options

Advanced

  • LSP (Language Server Protocol) integration
  • Split view (horizontal/vertical)
  • Diagnostic markers (errors, warnings)
  • Scroll marker panel
  • Column guides
  • Word wrap
  • Read-only mode
  • Word occurrence highlighting with scroll-bar tick marks

Settings

  • Built-in settings panel with auto-generated UI
  • JSON-based settings persistence (export/import)
  • Full DependencyProperty API for programmatic control

Included Assemblies

All bundled inside the package — zero external NuGet dependencies:

Assembly Purpose
WpfHexEditor.Editor.CodeEditor CodeEditorSplitHost UserControl (main entry point)
WpfHexEditor.Core Settings infrastructure, format detection, services
WpfHexEditor.Core.BinaryAnalysis Binary analysis services
WpfHexEditor.Core.Definitions 400+ embedded language/format definitions (.whfmt)
WpfHexEditor.Core.Events IDE event bus
WpfHexEditor.Core.ProjectSystem Language registry
WpfHexEditor.Editor.Core Shared editor abstractions
WpfHexEditor.Editor.TextEditor Base text editor
WpfHexEditor.ColorPicker Color picker for settings
WpfHexEditor.SDK Plugin contracts and interfaces

License

GNU Affero General Public License v3.0 (AGPL-3.0)

Product Compatible and additional computed target framework versions.
.NET net8.0-windows7.0 is compatible.  net9.0-windows was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0-windows7.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.9.6.6 36 4/13/2026
0.9.6.4 38 4/10/2026
0.9.6.3 39 4/10/2026
0.9.6.2 48 4/10/2026
0.9.6.1 38 4/10/2026