AlphaNecron / AvaloniaEdit

Avalonia-based text editor (port of AvalonEdit)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

downloads Current stable version

AvaloniaEdit

This project is a port of AvalonEdit WPF-based text editor for Avalonia.

AvaloniaEdit supports features like:

  • Syntax highlighting using TextMate grammars
  • Line numeration
  • Scrolling below document
  • Hyperlinks

and many,many more!

AvaloniaEdit currently consists of 3 packages

How to set up theme and syntax highlighting for my project?

First of all, if you want to use grammars that we support you should install package with them and package with TextMate integration otherwise you just install the package with TextMate integration and implement IRegistryOptions interface, that's currently the easiest way in case you want to use AvaloniaEdit with the set of grammars different from in-bundled.

//First of all you need to have a reference for your TextEditor for it to be used inside AvaloniaEdit.TextMate project.
var _textEditor = this.FindControl<TextEditor>("Editor");

//Here we initialize RegistryOptions with the theme we want to use.
var  _registryOptions = new RegistryOptions(ThemeName.DarkPlus);

//Initial setup of TextMate.
var _textMateInstallation = _textEditor.InstallTextMate(_registryOptions);

//Here we are getting the language by the extension and right after that we are initializing grammar with this language.
//And that's all 😀, you are ready to use AvaloniaEdit with syntax highlighting!
_textMateInstallation.SetGrammar(_registryOptions.GetScopeByLanguageId(_registryOptions.GetLanguageByExtension(".cs").Id));

image

About

Avalonia-based text editor (port of AvalonEdit)

License:MIT License


Languages

Language:C# 98.2%Language:HLSL 0.3%Language:JavaScript 0.2%Language:C 0.1%Language:Makefile 0.1%Language:TypeScript 0.1%Language:C++ 0.1%Language:Groovy 0.1%Language:Java 0.1%Language:Dart 0.1%Language:Lua 0.1%Language:Go 0.1%Language:Julia 0.1%Language:Perl 0.0%Language:Shell 0.0%Language:Roff 0.0%Language:HTML 0.0%Language:PHP 0.0%Language:Dockerfile 0.0%Language:Ruby 0.0%Language:CSS 0.0%Language:Swift 0.0%Language:SCSS 0.0%Language:XSLT 0.0%Language:CoffeeScript 0.0%Language:Handlebars 0.0%Language:R 0.0%Language:Pascal 0.0%Language:Less 0.0%Language:Pug 0.0%