[Monodevelop-devel] Dinamically changing the mime type to TextEditor.Document

Mike Krüger mkrueger at xamarin.com
Wed Nov 18 14:59:35 UTC 2015


Hi

In which scenario are you using the text editor ? Inside monodevelop (which
version ?) or stand alone ?

In general changing the mime type should've an immediate effect. You try to
use SyntaxModeService.GetSyntaxMode("text/html") and see if it returns
something and try setting editor.Document.SyntaxMode manually. (but as said
changing the mime type should do all that)

Regards
Mike

On Wed, Nov 18, 2015 at 2:30 PM, Daniel Peñalba <dpenalba at codicesoftware.com
> wrote:

> Hi
>
> When changing the mime type to a Mono.TextEditor.Document, the new syntax
> highlight colors are not drawn in the TextArea,
>
> I followeed Mike's suggestions on this thread, "dynamically change the
> MimeType on Mono.TextEditor":
>
>
> http://lists.ximian.com/pipermail/monodevelop-list/2012-February/014475.html
>
> So, I tried the following code:
>
> editor.Document.MimeType = "text/html";
> Mono.TextEditor.Highlighting.SyntaxModeService.WaitUpdate(editor.Document);
> editor.Document.CommitUpdateAll();
>
> But it still does nothing :-(
>
> Any other suggestion?
>
> Thanks in advance.
>
>     Daniel
>
> _______________________________________________
> Monodevelop-devel-list mailing list
> Monodevelop-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/monodevelop-devel-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/monodevelop-devel-list/attachments/20151118/87441bec/attachment.html>


More information about the Monodevelop-devel-list mailing list