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

Updated vim plugins

This commit is contained in:
amix
2016-03-20 19:01:44 +01:00
parent 20729bff94
commit 6dcca46b4a
20 changed files with 504 additions and 113 deletions

View File

@ -15,9 +15,7 @@ endf
" modified and improved version of vim-godef
function! go#def#Jump(...)
if !len(a:000)
" gives us the offset of the word, basicall the position of the word under
" he cursor
let arg = s:getOffset()
let arg = "-o=" . go#util#OffsetCursor()
else
let arg = a:1
endif
@ -43,7 +41,7 @@ endfunction
function! go#def#JumpMode(mode)
let arg = s:getOffset()
let arg = "-o=" . go#util#OffsetCursor()
let bin_path = go#path#CheckBinPath(g:go_godef_bin)
if empty(bin_path)
@ -65,18 +63,7 @@ endfunction
function! s:getOffset()
let pos = getpos(".")[1:2]
if &encoding == 'utf-8'
let offs = line2byte(pos[0]) + pos[1] - 2
else
let c = pos[1]
let buf = line('.') == 1 ? "" : (join(getline(1, pos[0] - 1), go#util#LineEnding()) . go#util#LineEnding())
let buf .= c == 1 ? "" : getline(pos[0])[:c-2]
let offs = len(iconv(buf, &encoding, "utf-8"))
endif
let argOff = "-o=" . offs
return argOff
return "-o=" . go#util#OffsetCursor()
endfunction