Skip to content
Snippets Groups Projects
Commit 671de2ac authored by Mike McQuaid's avatar Mike McQuaid Committed by GitHub
Browse files

Merge pull request #2528 from MikeMcQuaid/which_editor_fixes

utils: fix which_editor.
parents a1b8d417 688034d2
No related branches found
No related tags found
No related merge requests found
......@@ -320,15 +320,15 @@ def which_all(cmd, path = ENV["PATH"])
end
def which_editor
editor = ENV.values_at("HOMEBREW_EDITOR", "VISUAL").compact.first
editor = ENV.values_at("HOMEBREW_EDITOR", "VISUAL").compact.reject(&:empty?).first
return which(editor, ENV["HOMEBREW_PATH"]) unless editor.nil?
# Find Textmate
editor = "mate" if which "mate"
editor = which("mate", ENV["HOMEBREW_PATH"])
# Find BBEdit / TextWrangler
editor ||= "edit" if which "edit"
editor ||= which("edit", ENV["HOMEBREW_PATH"])
# Find vim
editor ||= "vim" if which "vim"
editor ||= which("vim", ENV["HOMEBREW_PATH"])
# Default to standard vim
editor ||= "/usr/bin/vim"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment