diff --git a/github/editor.go b/github/editor.go index 3b0f76ad43773bf57e968c9d99279435237bf3fe..b9df70e6491f5ee066e11861ac3b85786f854fe8 100644 --- a/github/editor.go +++ b/github/editor.go @@ -111,7 +111,7 @@ func (e *Editor) readContent() (content []byte, err error) { func openTextEditor(program, file string) error { editCmd := cmd.New(program) - r := regexp.MustCompile("[mg]?vi[m]$") + r := regexp.MustCompile(`\b(?:[gm]?vim|vi)\b`) if r.MatchString(program) { editCmd.WithArg("--cmd") editCmd.WithArg("set ft=gitcommit tw=0 wrap lbr")