Skip to content

Commit

Permalink
if pull-request editor is vim, set appropriate filetype
Browse files Browse the repository at this point in the history
  • Loading branch information
mislav committed Feb 7, 2012
1 parent 961f4b5 commit 5f546d4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/hub/commands.rb
Expand Up @@ -919,7 +919,9 @@ def pullrequest_editmsg(changes)
msg.puts changes.gsub(/^/, '# ').gsub(/ +$/, '')
end
}
edit_cmd = Array(git_editor).dup << message_file
edit_cmd = Array(git_editor).dup
edit_cmd << '-c' << 'set ft=gitcommit' if edit_cmd[0] =~ /^[mg]?vim$/
edit_cmd << message_file
system(*edit_cmd)
abort "can't open text editor for pull request message" unless $?.success?
title, body = read_editmsg(message_file)
Expand Down

0 comments on commit 5f546d4

Please sign in to comment.