Skip to content
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

Organize main highlighters alphabetically #839

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Twoody
Copy link

@Twoody Twoody commented Oct 13, 2021

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

@danielshahaf
Copy link
Member

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.

@Twoody
Copy link
Author

Twoody commented Oct 13, 2021

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

@phy1729
Copy link
Member

phy1729 commented Nov 14, 2021

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.

@danielshahaf
Copy link
Member

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

@phy1729 phy1729 modified the milestones: 0.8.0, 0.8.1 Dec 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants