mirror of
https://github.com/amix/vimrc
synced 2025-06-16 09:35:01 +08:00
Updated plugins
This commit is contained in:
16
sources_non_forked/vim-go/autoload/go/iferr.vim
Normal file
16
sources_non_forked/vim-go/autoload/go/iferr.vim
Normal file
@ -0,0 +1,16 @@
|
||||
function! go#iferr#Generate()
|
||||
let [l:out, l:err] = go#util#Exec(['iferr',
|
||||
\ '-pos=' . go#util#OffsetCursor()], go#util#GetLines())
|
||||
if len(l:out) == 1
|
||||
return
|
||||
endif
|
||||
if getline('.') =~ '^\s*$'
|
||||
silent delete _
|
||||
silent normal! k
|
||||
endif
|
||||
let l:pos = getcurpos()
|
||||
call append(l:pos[1], split(l:out, "\n"))
|
||||
silent normal! j=2j
|
||||
call setpos('.', l:pos)
|
||||
silent normal! 4j
|
||||
endfunction
|
Reference in New Issue
Block a user