Method: Act::Helper.open_in_editor_command

Defined in:
lib/act/helper.rb

.open_in_editor_command(path, line) ⇒ String

Returns:

  • (String)


10
11
12
13
14
15
16
17
18
19
20
# File 'lib/act/helper.rb', line 10

def self.open_in_editor_command(path, line)
  editor = ENV['EDITOR']
  result = "#{editor} #{path}"
  if line
    case editor
    when 'vim', 'mvim'
      result = "#{editor} #{path} +#{line}"
    end
  end
  result
end