wincent / command-t

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

<CR> opens unlisted buffer in a new split #317

Closed mkhl closed 6 years ago

mkhl commented 6 years ago

I believe this is also fixed by #315, but even if it's just another repro…

  1. Populate the quickfix list, say using :grep
  2. :CommandT
  3. Find a file that has a match in the quickfix list

Command-T opens a nobuflisted buffer with the file in a new split (instead of opening a “regular” buffer in the current window).

tap349 commented 6 years ago

@mkhl With that fix applied file is opened inside quickfix window (since it's the last focused window). Is it correct behaviour from your point of view?

mkhl commented 6 years ago

@tap349 After :grep I still have focus on the window that had it before, and command-t opens files there. If I move focus to the quickfix window then I think opening files there if fine.

wincent commented 6 years ago

I think this might be long-standing behavior, to avoid awkward things happening like, for example, opening a file in a very narrow special buffer like NERDTree when focused.

But having said that, even if that is the intention, the behavior when the quickfix window is focused is not very consistent, because the behavior you describe only happens when you open a file that has a match in the list (which is decidedly odd).

wincent commented 6 years ago

Tried it out with #315 (landed to the master branch) and the behavior seems to be reasonable. Going to close this, but please comment if you'd like to discuss further and I can re-open it.