Quantcast
Channel: MarsHut
Viewing all articles
Browse latest Browse all 6551

How should I implement Custom SyntaxMode in Mono.TextEditor

$
0
0
Currently, I'm trying to implement Syntax Highlighting for my custom
editor using Mono.TextEditor.

I can switch on CSharp syntax mode, but when I try to switch on my
definition of syntax I couldn't see any effects. It doesn't matter, if I
compile my syntax schema into Mono.TextEditor.dll or I try to read
definition from a file (my file is file from C# syntax definition with
change on mime type only).

This is my code:

private TextEditor edytor;

public Window2 () :
base (Gtk.WindowType.Toplevel)

this.Build ();

edytor = new TextEditor ();

vbox1.Add (edytor);
edytor.ShowAll ();
edytor.Text = GenerujText ();

edytor.Options.EnableSyntaxHighlighting = true;
edytor.Options.HighlightCaretLine = true;
edytor.Options.HighlightMatchingBracket = true;

WlaczTrybAdam ();

void WlaczTrybAdam()

var typMime = "text/adam";
edytor.Document.MimeType = typMime;

What am I doing wrong? How should I implement this feature?

Viewing all articles
Browse latest Browse all 6551

Trending Articles