Permalink
Browse files

Merge pull request #1604 from patheticpat/fix-vi-regex

Fix recognition logic for vi editor variants again
  • Loading branch information...
2 parents 14f4cb8 + ad61211 commit 5ce945e74713efe782cc10dc2fc08ea0b4fe099d @mislav mislav committed Oct 17, 2017
Showing with 2 additions and 2 deletions.
  1. +2 −2 github/editor.go
View
@@ -111,8 +111,8 @@ func (e *Editor) readContent() (content []byte, err error) {
func openTextEditor(program, file string) error {
editCmd := cmd.New(program)
- r := regexp.MustCompile(`\b(?:[gm]?vim|vi)\b`)
- if r.MatchString(program) {
+ r := regexp.MustCompile(`\b(?:[gm]?vim|vi)(?:\.exe)?$`)
+ if r.MatchString(editCmd.Name) {
editCmd.WithArg("--cmd")
editCmd.WithArg("set ft=gitcommit tw=0 wrap lbr")
}

0 comments on commit 5ce945e

Please sign in to comment.