Permalink
Browse files

Fallback to $VISUAL if no $EDITOR is found

  • Loading branch information...
1 parent bb3b869 commit 6a5625ff567b5b98a7456c4654173e32a94380d6 @oscardelben committed Apr 24, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/sheet.rb
View
@@ -50,7 +50,11 @@ def sheet_exists?(name)
# @return [String]
# Used to check the preferred editor for the user
def editor
- exec("echo $EDITOR").chomp
+ e = exec("echo $EDITOR").chomp
+ if e == ""
+ e = exec("echo $VISUAL").chomp
+ end
+ e
end
# If we're using mac, we should use open to open urls.

0 comments on commit 6a5625f

Please sign in to comment.