1
0
mirror of https://github.com/amix/vimrc synced 2025-06-16 09:35:01 +08:00

Replace YanRing with yank-stack and update plugins

This commit is contained in:
amix
2017-12-13 15:05:24 +01:00
parent 2ca843a22a
commit 53894de44b
72 changed files with 1663 additions and 5015 deletions

View File

@ -0,0 +1,55 @@
fun! Test_Detect_Gopath() abort
let l:gopath = $GOPATH
try
let g:go_autodetect_gopath = 1
let l:tmp = go#util#tempdir("pathdetect")
let l:tmp2 = go#util#tempdir("pathdetect-nogodep")
call mkdir(l:tmp . '/subdir', 'p')
call mkdir(l:tmp . '/Godeps/_workspace', 'p')
exe ':e ' . l:tmp . '/a.go'
call assert_equal(l:tmp . '/Godeps/_workspace:' . l:gopath, $GOPATH)
exe ':e ' . l:tmp . '/not-a-go-file'
call assert_equal(l:gopath, $GOPATH)
exe ':e ' . l:tmp . '/subdir/a.go'
call assert_equal(l:tmp . '/Godeps/_workspace:' . l:gopath, $GOPATH)
exec ':e ' . l:tmp2 . '/a.go'
call assert_equal(l:gopath, $GOPATH)
finally
let g:go_autodetect_gopath = 0
call delete(l:tmp, 'rf')
call delete(l:tmp2, 'rf')
endtry
endfun
fun! Test_Detect_Gopath_disabled() abort
let l:gopath = $GOPATH
try
let g:go_autodetect_gopath = 0
let l:tmp = go#util#tempdir("pathdetect")
let l:tmp2 = go#util#tempdir("pathdetect-nogodep")
call mkdir(l:tmp . '/subdir', 'p')
call mkdir(l:tmp . '/Godeps/_workspace', 'p')
exe ':e ' . l:tmp . '/a.go'
call assert_equal(l:gopath, $GOPATH)
exe ':e ' . l:tmp . '/not-a-go-file'
call assert_equal(l:gopath, $GOPATH)
exe ':e ' . l:tmp . '/subdir/a.go'
call assert_equal(l:gopath, $GOPATH)
exec ':e ' . l:tmp2 . '/a.go'
call assert_equal(l:gopath, $GOPATH)
finally
let g:go_autodetect_gopath = 0
call delete(l:tmp, 'rf')
call delete(l:tmp2, 'rf')
endtry
endfun