zsh-syntax-highlighting
zsh-syntax-highlighting copied to clipboard
Organize main highlighters alphabetically
For better readability and usability (seeing all possible options), alphabetical sorting is easier for users.
Thanks for the patch.
I don't think alphabetical sorting would be the best choice. Instead, we could group the entries semantically — e.g., all styles related to the command word together — as in _zsh_highlight_main_calculate_fallback, and then use alphabetical order within each group (e.g., list alias/builtin/command/function in this order). Groups could be separated by an empty line.
Please use meaningful log message (${area}: ${sentence} possibly followed by more details) so we don't have to fix that manually before merging.
@danielshahaf Thanks for taking a quick look and the reply :)
Please use meaningful log message (${area}: ${sentence} possibly followed by more details) so we don't have to fix that manually before merging.
Sure, most of the repos I've contributed to have squashed and used either their own commit message or the commit message in the PR title. I'll be mindful of your practices moving forward.
Instead, we could group the entries semantically
I think the question is if the docs are intended more for reference or pedagogy. For the former I would strongly argue alphabetical is best. For the latter grouping semantically would be better (perhaps with different levels of bullet points to denote fallback?). The rest of the file doesn't feel like a reference; so while I am fond of alphabetized lists, I think @danielshahaf is correct. Perhaps something like
Commands
arg0 etc
Arguments
path ... quoted ... glob?
Expansions
command substitution process substitution history expansion
Not sure what to call things like assign, redirection, comments and the like.
I think the question is if the docs are intended more for reference or pedagogy.
I assume that by "reference" you mean a random-access use case ("What's the foo style?") and by "pedagogy" you mean more of a read-through use case ("What features exist?")?
Not sure what to call things like assign, redirection, comments and the like.
"Miscellany"? "Other syntactical elements"?