zsh-syntax-highlighting icon indicating copy to clipboard operation
zsh-syntax-highlighting copied to clipboard

Organize main highlighters alphabetically

Open Twoody opened this issue 4 years ago • 4 comments
trafficstars

For better readability and usability (seeing all possible options), alphabetical sorting is easier for users.

Twoody avatar Oct 13 '21 15:10 Twoody

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 avatar Oct 13 '21 17:10 danielshahaf

@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.

Twoody avatar Oct 13 '21 18:10 Twoody

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.

phy1729 avatar Nov 14 '21 03:11 phy1729

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"?

danielshahaf avatar Nov 14 '21 04:11 danielshahaf