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

fish_indent handles semicolons at the end of the line funny #5859

Closed
faho opened this issue May 3, 2019 · 2 comments
Closed

fish_indent handles semicolons at the end of the line funny #5859

faho opened this issue May 3, 2019 · 2 comments
Labels
bug
Milestone

Comments

@faho
Copy link
Member

@faho faho commented May 3, 2019

While preparing #5858, I found this bit in share/completions/magento.fish:

complete -x -c magento -s h -l help -d "Show help for a command";
complete -x -c magento -s q -l quiet -d "Do not output any message";
complete -x -c magento -s v -l verbose -a "(__fish_print_magento_verbosity_levels)" -d "Increase verbosity: 1 for normal, 2 for verbose and 3 for debug";
complete -x -c magento -o -vv;
complete -x -c magento -o vvv;
complete -x -c magento -s V -l version -d "Show version";
complete -x -c magento -l ansi -d "Force colored output";
complete -x -c magento -l no-ansi -d "Disable colored output";
complete -x -c magento -s n -l no-interaction -d "Don't ask any interactive question";

turned into

complete -x -c magento -s h -l help -d "Show help for a command"

complete -x -c magento -s q -l quiet -d "Do not output any message"

complete -x -c magento -s v -l verbose -a "(__fish_print_magento_verbosity_levels)" -d "Increase verbosity: 1 for normal, 2 for verbose and 3 for debug"

complete -x -c magento -o -vv

complete -x -c magento -o vvv

complete -x -c magento -s V -l version -d "Show version"

complete -x -c magento -l ansi -d "Force colored output"

complete -x -c magento -l no-ansi -d "Disable colored output"

complete -x -c magento -s n -l no-interaction -d "Don't ask any interactive question"

Clearly fish_indent just sees the semicolon as two commands on one line and breaks them up on multiple lines. Only the second command is empty.

AAAAAAAAAA












is the result of printf '%s\n' 'AAAAAAAAAA;;;;;;;;;;;;' | fish_indent.

@faho faho added the bug label May 3, 2019
@faho faho added this to the fish 3.1.0 milestone May 3, 2019
faho added a commit to faho/fish-shell that referenced this issue May 3, 2019
This removes semicolons at the end of the line and collapses
consecutive ones, while replacing meaningful semicolons with newlines.

I.e.

```fish
echo;
```

becomes

```fish
echo
```

but

```fish
echo; echo
```

becomes

```fish
echo
echo
```

Fixes fish-shell#5859.
faho added a commit to faho/fish-shell that referenced this issue May 3, 2019
This required fish-shell#5859 to be fixed first.

[ci skip]
@zanchey
Copy link
Member

@zanchey zanchey commented Nov 28, 2019

I haven't put this in the CHANGELOG, FWIW.

@zanchey
Copy link
Member

@zanchey zanchey commented Nov 28, 2019

D'oh, you'd added it already! Sorry for the noise.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug
Projects
None yet
Development

No branches or pull requests

2 participants