提交 5ce945e7 编写于 作者: M Mislav Marohnić 提交者: GitHub

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

Fix recognition logic for vi editor variants again
......@@ -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")
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册