oni icon indicating copy to clipboard operation
oni copied to clipboard

Fugitive does not work in empty buffers.

Open Mantissa-23 opened this issue 8 years ago • 3 comments

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:

  1. Launch oni and cd into a git repository without opening any files.
  2. Enter :Gstatus or any other fugitive command

Mantissa-23 avatar Aug 22 '18 19:08 Mantissa-23

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.

oni-bot avatar Aug 22 '18 19:08 oni-bot

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(@%)

justinmk avatar Aug 23 '18 06:08 justinmk

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

badosu avatar Aug 23 '18 15:08 badosu