Vim-go: :GoDef should jump to an existing buffer if it's exists

Created on 6 Mar 2016  路  2Comments  路  Source: fatih/vim-go

Expected behavior

I expect to jump to an existing file via :GoDef.

Actual behavior

If the target file exists, :GoDef creates another view. We end up with two window with the same file.

Steps to reproduce:

  1. Jump to a file via :GoDef
  2. Go back to the source file and jump again via :GoDef
  3. :GoDef creates a new file

    Configuration

vimrc you used to reproduce:

https://github.com/fatih/dotfiles/blob/master/init.vim

vim version:

7.4

vim-go version:

HEAD - master

go version:

1.6

bug

Most helpful comment

@eduncan911 it's behind a new flag g:go_def_use_buffer and is disabled by default, so nothing has changed for you, FYI :)

All 2 comments

I actually like the existing functionality. It keeps it consistent with other :GoDef lookups popping up.

Maybe when changing this feature, create a config flag to enable the "jump to existing buffer instead of opening new window"? Or better yet, have it as an additional feature so we can add our own keybindings; one for using existing window and one for jumping to the existing buffer if I know it is already open.

@eduncan911 it's behind a new flag g:go_def_use_buffer and is disabled by default, so nothing has changed for you, FYI :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

orlangure picture orlangure  路  3Comments

SirmaXX picture SirmaXX  路  3Comments

wpaulino picture wpaulino  路  4Comments

mnarrell picture mnarrell  路  3Comments

johnzeng picture johnzeng  路  3Comments