Skip to content

Commit

Permalink
Merge pull request #3 from mattn/fix-vim
Browse files Browse the repository at this point in the history
add -e flag when vimpath is vim.exe
  • Loading branch information
rhysd authored Dec 6, 2022
2 parents 4daacc1 + a2310d3 commit 3ab4578
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions run_vim.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"os"
"os/exec"
"path/filepath"
"runtime"
"strconv"
"strings"
)
Expand All @@ -28,6 +29,13 @@ func runVim(vimpath string, extra []string, args ...string) error {
} else {
a = append(a, "--not-a-term")
}
if runtime.GOOS == "windows" {
if p, err := exec.LookPath(vimpath); err == nil {
if filepath.Base(p) == "vim.exe" {
a = append(a, "-e")
}
}
}
a = append(a, "-c", "qall!")
a = append(a, args...)

Expand Down

0 comments on commit 3ab4578

Please sign in to comment.