vile
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sh-mode highlight issue


From: Thomas Dickey
Subject: Re: sh-mode highlight issue
Date: Sat, 29 Jan 2022 16:09:09 -0500
User-agent: Mutt/1.10.1 (2018-07-13)

On Sat, Jan 29, 2022 at 07:51:53PM +0000, Wayne Cuddy via discussions 
concerning the vile text editor wrote:
> I'm not sure if this has been reported before, please forgive me if
> this is repetitious.
> 
> I'm running 9.8t and have not had a chance to upgrade to the
> latest/greatest yet but I don't see mention of this issue being
> corrected in the changelog. The closest I could find was comments from
> 9.7y:
> 
>     + improve vile-sh-filt for these cases:
>     + "${number}"
>     + "$(commands)"
>     + "$((expression))"
>     + "${name#value}", etc.
> 
> 
> The issue concerns $((expression)) expansions in variable assignments,
> but may not be limited to just this case.
> 
> var="prefix$((5*5))suffix"
       ^ string
                ^expression
                     ^ string?
> 
> prefix appears correctly highlighted, suffix does not, it seems the
> syntax highlighting terminates after the final ')' character.

Just looking at the source, the line

        <EXPRS>{BACKTIC2_UP}    { handle_backtic2(yytext, yyleng, 
LEN_BACKTIC2_DOWN, 0); }

is probably what should trigger on the "))", which takes it into

    if (FLTSTACK_OK && (which <= 0) && (FLTSTACK_THIS.backtic == test)) {

and fails there for some reason -- otherwise it would go back to the
string/literal coloring.

(I'm in the middle of ncurses, but may dig into it tomorrow to get a better
answer).

-- 
Thomas E. Dickey <dickey@invisible-island.net>
https://invisible-island.net
ftp://ftp.invisible-island.net

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]