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

Have funced check VISUAL as well as EDITOR. #2268

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
3 participants
@mwm
Contributor

mwm commented Aug 3, 2015

Both VISUAL and EDITOR are used for setting the preferred editor. Various applications disagree about which should be used, and there are examples that use either one and not the other. Recommended practice for users is to set them both to the same thing.

However, not everyone does that, so checking them both is a bit friendlier. Since VISUAL is usually the preferred editor when they are different, it should be checked first.

@faho

This comment has been minimized.

Show comment
Hide comment
@faho

faho Aug 6, 2015

The fishy way to do it would be

set -l editor
if set -q EDITOR
    set editor $EDITOR
else if set -q VISUAL
    set editor $VISUAL
else
    echo 'Please either set $EDITOR or $VISUAL'
    return 1
end

also that actually errors out early if no editor can be found.

faho commented on 0e07d55 Aug 6, 2015

The fishy way to do it would be

set -l editor
if set -q EDITOR
    set editor $EDITOR
else if set -q VISUAL
    set editor $VISUAL
else
    echo 'Please either set $EDITOR or $VISUAL'
    return 1
end

also that actually errors out early if no editor can be found.

@faho faho closed this in f3695b9 Sep 2, 2015

@faho

This comment has been minimized.

Show comment
Hide comment
@faho

faho Sep 2, 2015

Member

I just committed a slightly different solution. Please let me know if you are unhappy with that.

Member

faho commented Sep 2, 2015

I just committed a slightly different solution. Please let me know if you are unhappy with that.

faho added a commit to faho/fish-shell that referenced this pull request Sep 8, 2015

@zanchey zanchey added this to the next-2.x milestone Sep 11, 2015

@faho faho added the enhancement label Sep 26, 2015

@faho faho added the release notes label Oct 26, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment