<commit_before>if !exists("g:go_godef_bin")
	let g:go_godef_bin = "godef"
endif


" 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()
	else
		let arg = a:1
	endif

	let bin_path = go#path#CheckBinPath(g:go_godef_bin)
	if empty(bin_path)
		return
	endif

	let old_gopath = $GOPATH
	let $GOPATH = go#path#Detect()

	let command = bin_path . " -f=" . shellescape(expand("%:p")) . " -i " . shellescape(arg)

	" get output of godef
	let out=system(command, join(getbufline(bufnr('%'), 1, '$'), go#util#LineEnding()))

	" jump to it
	call s:godefJump(out, "")
	let $GOPATH = old_gopath
endfunction


function! go#def#JumpMode(mode)
	let arg = s:getOffset()

	let bin_path = go#path#CheckBinPath(g:go_godef_bin)
	if empty(bin_path)
		return
	endif

	let old_gopath = $GOPATH
	let $GOPATH = go#path#Detect()

	let command = bin_path . " -f=" . shellescape(expand("%:p")) . " -i " . shellescape(arg)

	" get output of godef
	let out=system(command, join(getbufline(bufnr('%'), 1, '$'), go#util#LineEnding()))<commit_msg>Support vimproc for godef<commit_after>if !exists("g:go_godef_bin")
	let g:go_godef_bin = "godef"
endif

if go#vimproc#has_vimproc()
	let s:vim_system = get(g:, 'gocomplete#system_function', 'vimproc#system2')
else
	let s:vim_system = get(g:, 'gocomplete#system_function', 'system')
endif

fu! s:system(str, ...)
	return call(s:vim_system, [a:str] + a:000)
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()
	else
		let arg = a:1
	endif

	let bin_path = go#path#CheckBinPath(g:go_godef_bin)
	if empty(bin_path)
		return
	endif

	let old_gopath = $GOPATH
	let $GOPATH = go#path#Detect()

	let command = bin_path . " -f=" . shellescape(expand("%:p")) . " -i " . shellescape(arg)

	" get output of godef
	let out=s:system(command, join(getbufline(bufnr('%'), 1, '$'), go#util#LineEnding()))

	" jump to it
	call s:godefJump(out, "")
	let $GOPATH = old_gopath
endfunction


function! go#def#JumpMode(mode)
	let arg = s:getOffset()

	let bin_path = go#path#CheckBinPath(g:go_godef_bin)
	if empty(bin_path)
		return
	endif

	let old_gopath = $GOPATH
	let $GOPATH = go#path#Detect()

	let command = bin_path . " -f=" . shellescape(expand("%:p")) . " -i " . shellescape(arg)

	" get output of godef
	let out=s:system(command, join(getbufline(bufnr('%'), 1, '$'), go#util#LineEnding()))
{'fraction_non_alphanumeric': 0.15532487504805845, 'fraction_numerical': 0.006151480199923107, 'mean_word_length': 4.656521739130435, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7177680', 'n_tokens_mistral': 1102, 'n_tokens_neox': 1030, 'n_words': 247}