Menu

#1767 Quoted Variables Are Not Highlighted In Bash Scripts

Bug
closed-fixed
nobody
5
2023-06-18
2015-10-15
JohnnyBoy
No

Originally raised via Notepad++ https://github.com/notepad-plus-plus/notepad-plus-plus/issues/995

Create a variable and use it in a command and the variable is highlighted in Orange.
Quote the variable and it turns grey.
e.g. $DATE is Orange on line 3 but Grey on line 4

!/bin/bash

DATE=$1
mkdir $DATE
FILENAME="$DATE".zip

Discussion

  • Kein-Hong Man

    Kein-Hong Man - 2015-10-15

    Speaking as someone to blame for a lot of the bash lexer code...
    The Bash lexer does not yet implement interpolated variable highlighting as done in the Perl lexer. Switch it to Perl and the $DATE in the string should be in bold and set apart from the literal parts of the string (in SciTE). Semantically, the string is currently only highlighted as a string in bash.
    I currently have no plans to implement interpolated variable highlighting for bash, busy and all that, but I'm sure Neil would consider accepting a good implementation and I can help test it too. The way I see it, it's nice to have, but one does not code bash scripts every day, and people tend to write much more convoluted stuff in Perl, so well, my current stance is "I welcome code contributions..."

     
  • Zufu Liu

    Zufu Liu - 2023-06-18
    • labels: --> lexilla, bash
    • status: open --> closed-fixed
     
  • Zufu Liu

    Zufu Liu - 2023-06-18

    Fixed in Lexilla 5.2.5 (set lexer.bash.styling.inside.* properties to 1).

     

Log in to post a comment.