-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Labels
Description
Environnement variable are not highlighted, example echo $foo $bar
$foo and $bar are white.
i think a line in tweak main would be appropriated.
example :
ZSH_HIGHLIGHT_STYLES[variable]
if the variable exist et is not empty.
ZSH_HIGHLIGHT_STYLES[variable-empty]
if the variable is not set or is empty.
i have posted this comment on another thread, tell me if it's better if i delete it to clean the thread.
thanks
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
danielshahaf commentedon May 26, 2020
Copying your previous comment for context:
Thanks, but I'll do that myself since I need to delete my own comment too.
$foo/bar
in command position: parameter expansions with pasted constant strings #484danielshahaf commentedon May 26, 2020
In
echo $foo
, the parameter expansion «$foo» can result in one of three different behaviours:$foo
is set and not empty)$foo
is either set to empty, or unset and theUNSET
option is at its default value)$foo
is unset and theUNSET
option is unset [i.e.,set -u
is in effect])If I understand correctly, @mirsella, you are asking for the
$foo
in cases (1) and (2) to be highlighted (differently in each case). Is that correct?I think there are existing issues for all of these: #509 [which I have just retitled] for (1), #718 for (2), #450 for (3), and #484 and #485 for some extra functionality. Accordingly, I'm inclined to close these issue as a duplicate of those other ones — unless there's some request here that's not covered by those other issues? If so, what is it?
[-][ Feature Request ] Support environnement variable highlighting : $foo[/-][+]Highlight parameter expansions : $foo[/+]danielshahaf commentedon May 26, 2020
(I've retitled the issue since it's not specifically about environment variables but about parameter expansions in general.)
mirsella commentedon May 26, 2020
thanks for the complete answer. sorry for my english
that precisely it.
i didn't found all of the issue you linked when i searched, it would have prevented this useless issue.
you can close this issue if you want since all of those issue you linked are separated part of my issue.
danielshahaf commentedon May 26, 2020
Thanks, closing. (You can subscribe to the other issues, of course.) In this case, finding other issues would have been not as straightforward as usual, because these are commonly known as "variables" but the zsh syntax documentation terms them "parameters" instead.