Skip to content

Commit

Permalink
Merge pull request #1604 from patheticpat/fix-vi-regex
Browse files Browse the repository at this point in the history
Fix recognition logic for vi editor variants again
  • Loading branch information
mislav committed Oct 17, 2017
2 parents 14f4cb8 + ad61211 commit 5ce945e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions github/editor.go
Expand Up @@ -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")
}
Expand Down

0 comments on commit 5ce945e

Please sign in to comment.