jacobslusser / ScintillaNET

A Windows Forms control, wrapper, and bindings for the Scintilla text editor.
MIT License
967 stars 245 forks source link

Lexer.Html does not support code folding #533

Open louisoft88 opened 1 year ago

louisoft88 commented 1 year ago

Hello,

If I use Html lexer the code folding disapppers. Cpp or Xml lexers do support code folding. Is this statement right or I am doing something wrong.

    /// <summary>
    /// Creates syntax coloring of HTML language
    /// </summary>
    public void CreateHtmlLanguage()
    {
        this.CurrentLanguage = Lexer.Html;
        TextArea.Lexer = this.CurrentLanguage;

        TextArea.SetKeywords(0, HtmlKeyWords);

        TextArea.StyleResetDefault();
        TextArea.Styles[Style.Default].Font = this.FontName;
        TextArea.Styles[Style.Default].Size = this.FontSize;
        TextArea.StyleClearAll();

        TextArea.Styles[Style.Html.Default].ForeColor = Utils.IntToColor(0x000000);
        TextArea.Styles[Style.Html.Comment].ForeColor = Utils.IntToColor(0x008000);
        TextArea.Styles[Style.Html.Number].ForeColor = Utils.IntToColor(0xFF0000);
        TextArea.Styles[Style.Html.DoubleString].ForeColor = Utils.IntToColor(0x8000FF);
        TextArea.Styles[Style.Html.SingleString].ForeColor = Utils.IntToColor(0x8000FF);
        TextArea.Styles[Style.Html.Tag].ForeColor = Utils.IntToColor(0x0000FF);
        TextArea.Styles[Style.Html.TagEnd].ForeColor = Utils.IntToColor(0x0000FF);
        TextArea.Styles[Style.Html.TagUnknown].ForeColor = Utils.IntToColor(0x000000);
        TextArea.Styles[Style.Html.Attribute].ForeColor = Utils.IntToColor(0xFF0000);
        TextArea.Styles[Style.Html.AttributeUnknown].ForeColor = Utils.IntToColor(0x000000);
        TextArea.Styles[Style.Html.CData].ForeColor = Utils.IntToColor(0xFF8000);
        TextArea.Styles[Style.Html.Value].ForeColor = Utils.IntToColor(0xFF8000);
        TextArea.Styles[Style.Html.Entity].ForeColor = Utils.IntToColor(0x000000);
    }

Thanks for any help. Louis