The following sequence of commands leaves the buffer with scrollbind and
cursorbind set:
:Gblame
Reblame with one of -, ~, or P
Quit with gq
What's happening here is:
1. In BlameSubcommand, we set scrollbind and cursorbind on the buffer.
We also set w:fugitive_leave on the blame buffer to reset scrollbind
and cursorbind when the blame buffer is closed.
2. In BlameJump, we execute Gedit, which changes the window to a new
buffer. Then, we delete the blame buffer, at which point we try to
reset scrollbind and cursorbind. However, the original buffer isn't
on a window anymore, so this doesn't do anything.
3. In BlameQuit, we go back to the original buffer. Note this snippet
from `:help local-options`: "if this buffer has been edited in this
window, the [option] values from back then are used". When the
original buffer was last used, scrollbind and cursorbind were still
set. Therefore, the buffer ends up with scrollbind and cursorbind
set after leaving Gblame.
The fix is to delete the blame buffer _before_ changing to the new
buffer in BlameJump. This ensures that we restore the options while the
original buffer is still around (which is how BlameQuit does it, too).
This is a follow-up to 28abadc.
Without the \zs, everything up to the regexp for the script ID would be
used.
Now, s:function() is the same as the one used in scriptease.
Staged/[MD]:
Unstage and checkout superproject recorded version
Staged/A:
Noop. 'git rm -f' would be appropriate but it is destructive for
non-staged changes and hard to undo
Unstaged/A:
Noop. Hard to reproduce in practice, 'git status' doesn't handle it well
and hard to undo
Unstaged/[MD]:
Checkout superproject recorded version
Unstaged/[m?]:
Noop. Discarding submodules content changes is too complicated.
Workaround is to <CR> to submodule and discard from it's :Gstatus.
When the line is reverse-blamed to an *immediate* child of the current
commit it is shown as `^commit` in the reverse blame output. In this
case we still need to open the child of this commit since it will be a
commit removing the line.
Closes https://github.com/tpope/vim-fugitive/issues/1359
Note that in the context of this event, Fugitive functions will use the
changed repository, which might not be the same as the current buffer's
repository. Pass bufnr() as the optional dir argument to force the
current buffer.
Closes https://github.com/tpope/vim-fugitive/issues/458
If any other plugins besides `vim-fugitive` are present in user's
instance of Vim, they can call external programs to show some
properties. Redraw will force them to call this programs again and value
of last shell error can be changed.