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

abbr: expand command abbrs after decorators #10396

Merged
merged 2 commits into from Mar 27, 2024
Merged

Conversation

faho
Copy link
Member

@faho faho commented Mar 26, 2024

Currently, we expand command-abbrs (those with --position command) after if, but not after command or builtin or time:

abbr --add gc "git checkout"

will expand as if gc but not as command gc.

This was explicitly tested, but I have no idea why it shouldn't be?

Looking at the git history nothing really springs up as explanation.

TODOs:

  • Changes to fish usage are reflected in user documentation/manpages.
  • Tests have been added for regressions fixed
  • User-visible changes noted in CHANGELOG.rst

Currently, we expand command-abbrs (those with `--position command`) after `if`, but not after `command` or `builtin` or `time`:

```fish
abbr --add gc "git checkout"
```

will expand as `if gc` but not as `command gc`.

This was explicitly tested, but I have no idea why it shouldn't be?
@faho faho added this to the fish next-3.x milestone Mar 26, 2024
@ridiculousfish ridiculousfish self-requested a review March 27, 2024 01:27
@ridiculousfish
Copy link
Member

I think I considered command to be an escape hatch in case you wanted to run some real command. But it's probably not wise to make abbreviations that are also real commands. Anyways I'm fine with this change.

@faho faho merged commit 217b009 into fish-shell:master Mar 27, 2024
7 checks passed
@faho faho deleted the decorated-abbr branch March 27, 2024 16:18
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.

None yet

2 participants