[MonoDevelop] How should I implement Custom SyntaxMode in Mono.TextEditor
Adam Kruszewski
kruchy.jr at wp.pl
Sun Jul 20 15:13:14 UTC 2014
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?
--
pozdrawiam
Adam Kruszewski
More information about the Monodevelop-list
mailing list