No description
Find a file
2026-05-29 08:22:30 -07:00
.github Update readme 2023-01-06 02:48:30 +10:00
src reference ImGui bundle instead of stock 2026-05-29 08:22:30 -07:00
.gitignore Misc fixes, eliminate per-frame allocations 2023-01-04 23:00:56 +10:00
build_nuget.bat Fixes and improvements, first nuget release 2023-01-27 17:24:27 +10:00
LICENSE Cleanup and add license/readme 2023-01-06 02:38:13 +10:00
README.md Update readme 2023-01-06 02:48:30 +10:00
TextEdit.Deps.sln Rendering improvements 2024-02-11 15:24:01 +10:00
TextEdit.sln Cleanup and add unit tests 2023-01-10 02:19:33 +10:00

ImGuiColorTextEditNet

C# port of syntax highlighting text editor for ImGui Screenshot

C# Specific notes:

  • The way the syntax highlighting works has been changed
  • Regex-based syntax highlighting hasn't been ported yet
  • There's likely to still be a few regressions from the porting process
  • A small demo project using veldrid is provided.

Description from original project:

This started as my attempt to write a relatively simple widget which provides text editing functionality with syntax highlighting. Now there are other contributors who provide valuable additions.

While it relies on Omar Cornut's https://github.com/ocornut/imgui, it does not follow the "pure" one widget - one function approach. Since the editor has to maintain a relatively complex and large internal state, it did not seem to be practical to try and enforce fully immediate mode. It stores its internal state in an object instance which is reused across frames.

The code is (still) work in progress, please report if you find any issues.

Main features

  • approximates typical code editor look and feel (essential mouse/keyboard commands work - I mean, the commands I normally use :))
  • undo/redo
  • UTF-8 support
  • works with both fixed and variable-width fonts
  • extensible syntax highlighting for multiple languages
  • identifier declarations: a small piece of description can be associated with an identifier. The editor displays it in a tooltip when the mouse cursor is hovered over the identifier
  • error markers: the user can specify a list of error messages together the line of occurence, the editor will highligh the lines with red backround and display error message in a tooltip when the mouse cursor is hovered over the line
  • large files: there is no explicit limit set on file size or number of lines (below 2GB, performance is not affected when large files are loaded (except syntax coloring, see below)
  • color palette support: you can switch between different color palettes, or even define your own
  • whitespace indicators (TAB, space)