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

feat: sort help #506

Merged
merged 1 commit into from
Oct 30, 2024
Merged

feat: sort help #506

merged 1 commit into from
Oct 30, 2024

Conversation

Foo-x
Copy link
Contributor

@Foo-x Foo-x commented Oct 29, 2024

Add a feature that sorts the help menu by description.

Closes #376

image

local sorted_indices = {}
for i = 1, #col_desc do
sorted_indices[i] = i
end
table.sort(sorted_indices, function(i, j)
return col_desc[i] < col_desc[j]
end)

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we're going to have to sort these, I think it would be cleaner to merge the col_left and col_desc tables into a single list of {<keymap>, <desc>} tuples and sort that directly

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed it as you suggested.

@stevearc
Copy link
Owner

LGTM thanks for the PR!

@stevearc stevearc merged commit 52cc8a1 into stevearc:master Oct 30, 2024
9 checks passed
@Foo-x Foo-x deleted the sort-help branch October 30, 2024 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feature request: natural order of help menu
2 participants