Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'fix-mvim' of https://github.com/nel/interactive_editor

Conflicts:
	lib/interactive_editor.rb
  • Loading branch information...
commit 7fe641ee414caeabafddbff9614300c389589bac 2 parents ea6c7da + a09af52
Jan Berkel authored
Showing with 6 additions and 2 deletions.
  1. +6 −2 lib/interactive_editor.rb
8 lib/interactive_editor.rb
View
@@ -38,7 +38,7 @@ def edit(object, file=nil)
mtime = File.stat(@file.path).mtime
end
- args = Shellwords.shellwords(@editor) #parse @editor as arguments could be complexe
+ args = Shellwords.shellwords(@editor) #parse @editor as arguments could be complex
args << current_file.path
Exec.system(*args)
@@ -86,7 +86,11 @@ module Editors
:emacs => nil,
:nano => nil,
:mate => 'mate -w',
- :mvim => 'mvim -g -f -c "au VimLeave * !open -a Terminal"'
+ :mvim => 'mvim -g -f' + case ENV['TERM_PROGRAM']
+ when 'iTerm.app'; ' -c "au VimLeave * !open -a iTerm"'
+ when 'Apple_Terminal'; ' -c "au VimLeave * !open -a Terminal"'
+ else '' #don't do tricky things if we don't know the Term
+ end
}.each do |k,v|
define_method(k) do |*args|
InteractiveEditor.edit(v || k, self, *args)
Please sign in to comment.
Something went wrong with that request. Please try again.