Cannot Style ScintillaNet Text after or before syntax coloring

Topics: User Forum
Feb 23, 2011 at 6:46 PM
Edited Feb 23, 2011 at 6:46 PM
var scin = new Scintilla();
ScintillaHotspotStyle = scin.Styles.LastPredefined.Index + 1;
scin.Margins[0].Width = 20;
scin.Caret.HighlightCurrentLine = true;

scin.Styles[ScintillaHotspotStyle].IsHotspot = true;
scin.Styles[ScintillaHotspotStyle].Underline = true;
scin.Styles[ScintillaHotspotStyle].ForeColor = System.Drawing.Color.Blue;

var contents = File.ReadAllText(file);
scin.Text = contents;

//scin.ConfigurationManager.Language = "cpp";

scin.GetRange(2, 5).SetStyle(ScintillaHotspotStyle);

//scin.ConfigurationManager.Language = "cpp";

It doesn't matter which order of the commented lines, nor if the call to .Configure() is performed - the outcome is the same:

If however, I do not apply the syntax highlighting, it does work:

Scintilla is pretty confusing, so I'm probably doing something wrong - but I'm not sure what...