1
0
Fork 0
mirror of synced 2024-11-16 22:15:34 -05:00
ultimate-vim/sources_non_forked/vim-go/autoload/go/iferr.vim
Amir Salihefendic 2f164fee9b Updated plugins
2018-07-04 12:53:25 +02:00

16 lines
409 B
VimL

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