wincent / command-t

⌨️ Fast file navigation for Neovim and Vim
BSD 2-Clause "Simplified" License
2.76k stars 321 forks source link

Can't switch to buffers in another tab #306

Closed bgerstle-lookback closed 7 years ago

bgerstle-lookback commented 7 years ago

Steps:

  1. Open FileA
  2. Open FileB in a new tab (e.g. :tabe FileB)
  3. Executed :CommandTOpen e FileA (or select from :CommandTBuffer list)

Expected results:

vim switches to FileA.

Actual results:

vim opens FileA in current tab.


$ vim --version
vim --version
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Apr  4 2017 18:14:54)
Included patches: 1-898, 8056
Compiled by root@apple.com
Normal version without GUI.  Features included (+) or not (-):
+acl             -farsi           -mouse_netterm   +syntax
-arabic          +file_in_path    -mouse_sgr       +tag_binary
+autocmd         +find_in_path    -mouse_sysmouse  +tag_old_static
-balloon_eval    +float           -mouse_urxvt     -tag_any_white
-browse          +folding         +mouse_xterm     -tcl
+builtin_terms   -footer          +multi_byte      +terminfo
+byte_offset     +fork()          +multi_lang      +termresponse
+cindent         -gettext         -mzscheme        +textobjects
-clientserver    -hangul_input    +netbeans_intg   +title
-clipboard       +iconv           +path_extra      -toolbar
+cmdline_compl   +insert_expand   -perl            +user_commands
+cmdline_hist    +jumplist        +persistent_undo +vertsplit
+cmdline_info    -keymap          +postscript      +virtualedit
+comments        -langmap         +printer         +visual
-conceal         +libcall         -profile         +visualextra
+cryptv          +linebreak       +python/dyn      +viminfo
+cscope          +lispindent      -python3         +vreplace
+cursorbind      +listcmds        +quickfix        +wildignore
+cursorshape     +localmap        +reltime         +wildmenu
+dialog_con      -lua             -rightleft       +windows
+diff            +menu            +ruby/dyn        +writebackup
+digraphs        +mksession       +scrollbind      -X11
-dnd             +modify_fname    +signs           -xfontset
-ebcdic          +mouse           +smartindent     -xim
-emacs_tags      -mouseshape      -sniff           -xsmp
+eval            -mouse_dec       +startuptime     -xterm_clipboard
+ex_extra        -mouse_gpm       +statusline      -xterm_save
+extra_search    -mouse_jsbterm   -sun_workshop    -xpm
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
  fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H     -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc   -L/usr/local/lib -o vim        -lm -lncurses  -liconv

.vimrc is setup via my dotfiles. I've added the set switchbuf=usetab, and CommandTOpen works for buffers in split panes, but not buffers in another tab.

wincent commented 7 years ago

Thanks for the report, @bgerstle-lookback. Something tells me this is a regression, as I don't recall this happening in the past.

Likely suspects: 85949ce and/or 595976e.

bgerstle commented 7 years ago

Back from my personal account 😅 Confirmed that this is a regression: rolling back to 5.0.0 restored CommandTOpen functionality.

wincent commented 7 years ago

I think I know what's wrong. I'll push a fix in a bit.

Aster89 commented 3 years ago

Sometimes I do desire the bugged behavior. Can it be made available somehow?

Why do I want it (not all the time, but sometimes)?

Let's say I have this layout where I'm editing file2 in tab1 while giving a look at related files file1 and fileX

_______________________     _______________________
|tab1                 |     |tab2                 |
-----------------------     -----------------------
|         |           |     |         |           |
|  fileX  |           |     |         |           |
|         |           |     |         |           |
|---------|   file2   |     |         |   file4   |
|         |           |     |         |           |
|  file1  |           |     |  file3  |           |
|         |           |     |         |           |
-----------------------     -----------------------

then I go to tab2 where I have to edit file4 while giving a look at file3 and fileX (the same as the other tab).

Usually I'd move to tab2-file3 (well, this can be done with the non-bugged version of the functinality you fixed here, ahahah), hit Ctrl-ws, and then use this plugin to open fileX. However, since fileX is already opened in the other tab, the focus jumps there.