Independent case-sensitivity for command aliases#1878
Merged
rolandwalker merged 1 commit intomainfrom May 2, 2026
Merged
Conversation
* convert SpecialCommand from a named tuple to a dataclass * add SpecialCommandAlias to hold alias strings and case preference for the alias alone * always use "alias" instead of "shortcut" internally * always use list or None when setting aliases internally, deferring the choice of the first element until presentation * make sure every special command passes a non-None usage, and make the argument a str type * vertical format when registering a special command, for readability Motivation: to set case-sensitivity in the way that makes the most sense for each command and alias. For example, most non-alias commands such as "\edit" can probably become case-insensitive. But the short form "\e" might remain case-sensitive. Thinking ahead, we may want to add more properties to the dataclass to support help on special commands. The intention is that there is no functional change in this refactor.
abbfa80 to
f89d5f6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
SpecialCommandfrom a named tuple to a dataclassSpecialCommandAliasto hold alias strings and case preference for the alias alonelistorNonewhen setting aliases internally, deferring the choice of the first element until presentationNoneusage, and make the argument astrtypeMotivation: to set case-sensitivity in the way that makes the most sense for each command and alias. For example, most non-alias commands such as
\editcan probably become case-insensitive. But the short form\emight remain case-sensitive.Thinking ahead, we may want to add more properties to the dataclass to support nicer help on special commands.
The intention is that there is no functional change in this refactor.
Checklist
changelog.mdfile.AUTHORSfile (or it's already there).