Skip to content

Subword highlighting #495

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
danielshahaf opened this issue Jan 21, 2018 · 0 comments
Open

Subword highlighting #495

danielshahaf opened this issue Jan 21, 2018 · 0 comments

Comments

@danielshahaf
Copy link
Member

Currently, echo foo paints foo in 5 8 none and echo "foo" paints "foo" in 5 10 none 5 10 fg=yellow. These correspond to (default) and (default double-quoted-argument) in terms of styles.

This seems asymmetric, shouldn't there be some un-quoted-argument style to parallel double-quoted-argument? So the rule would be that each word gets a "word style" (single-hyphen-option, path, positional-argument) and "subword styles" for any ''/$''/""-quoted portions thereof?

This is a consequence of the recent changes that made double-quoted-argument a subword style; before that the only case resembling subword styles was dollar-double-quoted-argument: : "$foo"typeset -a region_highlight=( '0 1 fg=green' '2 8 fg=yellow' '3 7 fg=cyan' ). This case still exists, so things like rsync --"delete-${when}" have three layers of nesting: double-hyphen-option, double-quoted-argument, dollar-double-quoted-argument.

Compare #362 (zstyle).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant