Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update jumplist in :GoDef #1029

Merged
merged 1 commit into from
Aug 27, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions autoload/go/def.vim
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ function! s:jump_to_declaration(out, mode)
" modes of switchbuf which we need based on the split mode
let old_switchbuf = &switchbuf

let l:fname = fnamemodify(expand("%"), ':p:gs?\\?/?')
if filename != l:fname
normal! m'
if filename != fnamemodify(expand("%"), ':p:gs?\\?/?')
" jump to existing buffer if, 1. we have enabled it, 2. the buffer is loaded
" and 3. there is buffer window number we switch to
if get(g:, 'go_def_reuse_buffer', 0) && bufloaded(filename) != 0 && bufwinnr(filename) != -1
Expand All @@ -134,7 +134,7 @@ function! s:jump_to_declaration(out, mode)
endif

" open the file and jump to line and column
exec 'edit '.filename
exec 'edit' filename
endif
call cursor(line, col)

Expand Down Expand Up @@ -248,7 +248,7 @@ function! go#def#Stack(...)
let target = s:go_stack[s:go_stack_level]

" jump
exec 'edit '.target["file"]
exec 'edit' target["file"]
call cursor(target["line"], target["col"])
normal! zz
else
Expand Down