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

fix error when completing vi if it didnt exist #3336

Merged
merged 2 commits into from Aug 27, 2016
Merged

fix error when completing vi if it didnt exist #3336

merged 2 commits into from Aug 27, 2016

Conversation

Cobrand
Copy link
Contributor

@Cobrand Cobrand commented Aug 27, 2016

Description

If vi wasn't in the OS by default, invoking completion with vi instantiated an error :

fish: Unknown command 'vi'
/usr/share/fish/completions/vi.fish (line 8): if vi --version > /dev/null ^ /dev/null
...

This commit fixed that by checking if 'vi' exists with the 'type' command beforehand

complete -c vi -r -s t --description 'Edit the file containing a tag'
complete -c vi -r -c t --description 'Begin editing by executing the specified editor command'
# Check if vi exists at all ( needed for vi --version )
if type vi > /dev/null ^ /dev/null
Copy link
Member

Choose a reason for hiding this comment

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

type -q vi.

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, changed to type -q

@faho
Copy link
Member

faho commented Aug 27, 2016

Not really a crash, but probably worthwhile.

@faho faho added bug Something that's not working as intended completions labels Aug 27, 2016
@Cobrand Cobrand changed the title fix crash when completing vi if it didnt exist fix error when completing vi if it didnt exist Aug 27, 2016
@faho faho merged commit 172541c into fish-shell:master Aug 27, 2016
@faho
Copy link
Member

faho commented Aug 27, 2016

Thanks, merged!

@faho faho added this to the next-2.x milestone Aug 27, 2016
@krader1961 krader1961 modified the milestones: fish 2.4.0, next-2.x Sep 3, 2016
nomaed pushed a commit to nomaed/fish-shell that referenced this pull request Jul 17, 2017
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something that's not working as intended completions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants