Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#174 Allow External Lexer to Have Themes Feature

open
nobody
None
5
2014-08-17
2010-01-29
Garthex
No

This patch allows external lexers to supply stylers that correspond to themes.

Xml Structure
It looks for a tag inside of LexerType called ThemeStyles and within ThemeStyles are a list of Theme tags with the name attribute being the theme name. Inside each Theme tag is a list of WordStyles, exactly as they appear within LexerType. The default no-theme styles will stay where they are inside LexerType.

Why is this necessary?
This allows an external lexer plugin developer to assign styles for their lexers that get activated when a user changes theme. The user can also edit the themes for an external lexer that correspond to a new theme and will create the necessary xml tags, allowing for complete backwards-compatibility.

I've attached a sample xml from my GmodLua plugin, though the styles are just duplicates of the default style. Also, this can be tested with any pre-existing lexer plugin.

Discussion

  • Garthex
    Garthex
    2010-01-29

    External Lexer Themes Patch

     
  • Garthex
    Garthex
    2010-01-29

    Sample xml file from GmodLua plugin

     
    Attachments
  • Garthex
    Garthex
    2010-10-11

    Don, can you take a look at this? I think it's a nice solution to the problem I'm having. I'd like users to be able to use themes properly.

    The current workaround is to give users a different GmodLua.xml for each theme and they can install them on their own, or give an updated <theme>.xml for each of the existing themes. (neither workaround is desired, since most users just use the plugin manager)

     
  • Garthex
    Garthex
    2010-10-11

    Actually, thinking about it, this may not be the best solution. Consider:

    User installs external lexer plugin
    User installs custom theme X.
    User edits styles in configurator to match theme X for external lexers
    User updates external lexer plugin
    Update process resets plugin.xml and user loses changes.

    Do you have any suggestions?