Method: Doing::Util#args_for_editor

Defined in:
lib/doing/util.rb

#args_for_editor(editor) ⇒ Object



149
150
151
152
153
154
155
156
157
158
159
160
161
# File 'lib/doing/util.rb', line 149

def args_for_editor(editor)
  return editor if editor =~ /-\S/

  args = case editor
         when /^(subl|code|mate)$/
           ['-w']
         when /^(vim|mvim)$/
           ['-f']
         else
           []
         end
  "#{editor} #{args.join(' ')}"
end