Permalink
Browse files

if `pull-request` editor is vim, set appropriate filetype

  • Loading branch information...
1 parent 961f4b5 commit 5f546d4242b547e82611ecc68499506c0e6ad53c @mislav mislav committed Feb 7, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/hub/commands.rb
View
4 lib/hub/commands.rb
@@ -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)

0 comments on commit 5f546d4

Please sign in to comment.