mirror of
https://github.com/gopasspw/gopass.git
synced 2025-12-08 19:24:54 +00:00
Fixes #2424 RELEASE_NOTES=[BUGFIX] Fix vim invocation. Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org> Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
29 lines
786 B
Go
29 lines
786 B
Go
package editor
|
|
|
|
import (
|
|
"runtime"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestVimArgs(t *testing.T) {
|
|
t.Parallel()
|
|
|
|
if runtime.GOOS != "linux" {
|
|
t.Skip("not supported")
|
|
}
|
|
|
|
for ed, args := range map[string][]string{
|
|
"vi": {"-c", "autocmd BufNewFile,BufRead /dev/shm/gopass* setlocal noswapfile nobackup noundofile viminfo=\"\"", "-i", "NONE", "-n"},
|
|
"nvi": {},
|
|
"neovim": {"-c", "autocmd BufNewFile,BufRead /dev/shm/gopass* setlocal noswapfile nobackup noundofile shada=\"\"", "-i", "NONE", "-n"},
|
|
"vim": {"-c", "autocmd BufNewFile,BufRead /dev/shm/gopass* setlocal noswapfile nobackup noundofile viminfo=\"\"", "-i", "NONE", "-n"},
|
|
} {
|
|
if ed == "vi" && !isVim(ed) {
|
|
args = []string{}
|
|
}
|
|
assert.Equal(t, args, vimOptions(ed), ed)
|
|
}
|
|
}
|