Fugitive does not work in empty buffers.
Oni Version: 0.3.6 Operating System: Windows
Issue: When entering the :GStatus or any other Vim-Fugitive command while in an empty buffer is not behaving the same as Neovim or Vim with the same init.vim file loaded.
I believe this is related to #2480, and might be indicative of some deeper issue that subtly affects certain plugins like Fugitive. I have no insight as to what the root cause of this issue might be, however.
Expected behavior: Terminal Vim 8.0.1476 and Neovim v0.2.2 both will open the Git Status window without requiring an open buffer. I would assume that Oni is expected to behave identically.
Actual behavior: E492: not an editor command; Gstatus. This does not occur if the buffer is a file open in the project.
Steps to reproduce: My nvim dotfiles can be found here; I have not tested with a bare configuration. Steps:
- Launch oni and
cdinto a git repository without opening any files. - Enter
:Gstatusor any other fugitive command
Hello and welcome to the Oni repository! Thanks for opening your first issue here. To help us out, please make sure to include as much detail as possible - including screenshots and logs, if possible.
fugitive never works in "empty buffers" except for a special-case of the first buffer on startup, because that is special-cased in fugitive. Fugitive can be made to work on any empty buffer by calling:
:call fugitive#detect(@%)
As Justin said, this is Fugitive's default behaviour, see how many feature requests exist for this:
- https://github.com/tpope/vim-fugitive/issues/179
- https://github.com/tpope/vim-fugitive/issues/243
- https://github.com/tpope/vim-fugitive/issues/832
Tpope is considering changing this, see: https://github.com/tpope/vim-fugitive/issues/1000