Quantcast
Channel: ScintillaNET Forum Rss Feed
Viewing all articles
Browse latest Browse all 296

New Post: Highlight INI files?

$
0
0
Thank You!

I disabled usage of the SCide.IniLexer class and this code works fine with the built-in lexer:
public static class ScintillaConstants
{
    public const int SCE_PROPS_DEFAULT = 0;
    public const int SCE_PROPS_COMMENT = 1;
    public const int SCE_PROPS_SECTION = 2;
    public const int SCE_PROPS_ASSIGNMENT = 3;
    public const int SCE_PROPS_DEFVAL = 4;
    public const int SCE_PROPS_KEY = 5;
}

// ...

// (here editor is instance of the Scintilla editor component)
editor.Lexing.Lexer = ScintillaNET.Lexer.Properties;
editor.Styles[ScintillaConstants.SCE_PROPS_KEY].ForeColor = Color.FromArgb(0, 0, 153);
editor.Styles[ScintillaConstants.SCE_PROPS_ASSIGNMENT].ForeColor = Color.OrangeRed;
editor.Styles[ScintillaConstants.SCE_PROPS_DEFVAL].ForeColor = Color.FromArgb(102, 0, 102);
editor.Styles[ScintillaConstants.SCE_PROPS_COMMENT].ForeColor = Color.DarkGreen; // Color.FromArgb(102, 102, 102);
editor.Styles[ScintillaConstants.SCE_PROPS_SECTION].ForeColor = Color.DarkRed; // Color.FromArgb(0, 0, 102);
editor.Styles[ScintillaConstants.SCE_PROPS_SECTION].Bold = true;
The only drawback is that the native "Properties" lexer has no "quoted style" defined :(

Viewing all articles
Browse latest Browse all 296

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>