#1052 Request: Syntax Color Highlight For $VARIABLES



I'm using Geany 1.24.1 which is my understanding using/based off of Scintilla.

I was told that this is an issue that needs to be directed to the Scintilla developers and I hope this will get great consideration in a next release.

I personally need a text editor that gives syntax hightlight for various $VARIABLES,
often used when compiling source from build scripts;


Anything and everything listed with $ that can be thought of and used. Right now this is not supported in Scintilla for syntax color highlighting.

Thank you very much for your time and consideration and hopes on seeing this soon...


  • Neil Hodgson

    Neil Hodgson - 2014-06-19
    • labels: --> scintilla, lexer
    • assigned_to: Neil Hodgson
    • Priority: 5 --> 2
  • Neil Hodgson

    Neil Hodgson - 2014-06-19

    This requires writing a lexer to interpret the language or to add it to an existing lexer that is used for the language. You could read the Scintilla documentation and write your own lexer in C++ or convince someone else to write the lexer.

    I only work on lexers for languages that I use.

  • SourceBugs

    SourceBugs - 2014-06-20


    To begin I'm not a coder, it's my understanding as a geek when the word, 'language' is being used, then we're talking about actual 'Coding Languages', c, c++, java, python, ruby, etc...

    So I'm not talking about a coding language, I'm asking about having highlighting for $VARIABLES a person would use when compiling source from a build script.

    I use Slackware, maybe you are familiar with slackbuilds.org?

    Please have a look at the link below for a slackware build script to compile scite as an example;


    Notice all the different $VARIABLES as I mentioned before, along with Linux commands.

    This is just common basic scripting a sh shell script to compile from, and many developers and distros do the same thing.

    I'm actually quite surprised this support was never included since the beginning, and I certainly mean you no disrespect at all, I'm only stating something is all, but it surprises me like no one compiles source from a build script, that would of done this?

    So when you talk about lexers for a language, where does this come into play since this not about a language, but $VARIABLES used when building source from compile scripts?

    This just seems more like having support for different 'keywords' is all...

    So PLEASE can we get someone to add in this type of support?

    Thank you...

    Last edit: SourceBugs 2014-06-20
    • Neil Hodgson

      Neil Hodgson - 2014-06-20

      The $-prefixed things are only variables in the context of a language defining the syntax of variables. The bash lexer highlights simple words that start with $ as scalars. I do not work on the bash lexer.

    • Kein-Hong Man

      Kein-Hong Man - 2014-06-20

      For most users, current shell highlighting is "good enough". It's easy for upstream editors like Geany to point back to the Scintilla project, but the fact is, Scintilla don't have tons of developer resources to implement each and every requested feature. For example, I am sorta the unofficial shell highlighting maintainer, having contributed many patches for it, but I'm just an advanced user who contributes, I have plenty of real life stuff that I need to prioritize in advance of Scintilla.

      Now, as for highlighting of special variables, highlighting of variables in general is adequate for most users. I'm not a fan of the bash developers implementing 1001 kinds of syntax in bash and as such I'm not going to enthusiastically make it my duty to implement super perfectly detailed highlighting code.

      If you want a special style for certain variables, things start to get complicated quickly. At first we can scan for standard variables like $OUTPUT in your example. But then they are used in many different situation and impact many different styles.

      ${PRGNAM} as opposed to $PRGNAM
      in backticks like $(echo $VERSION | tr -d .)
      in interpolated strings like "s%xdg-open%$HELPBROWSER%g"
      extended forms like ${OUTPUT:-/tmp}

      Each one of the styles need to be checked for. Highlighting of variables in strings or backticks etc is not trivial to implement properly, look at the Perl lexer source code for an example. Extended forms can become pretty complicated, what bits should be highlighted then? So it's not a simple thing when it comes to actually doing a patch for this thing...

      I would not oppose a patch for this, but I am not going to work on this myself.

  • SourceBugs

    SourceBugs - 2014-06-20

    thanks guys, maybe in time something can be made to work...


Log in to post a comment.