Commit 3936a74
Reset scrollbind/cursorbind after reblaming
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).1 parent a2d76c4 commit 3936a74
1 file changed
+1
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5130 | 5130 | | |
5131 | 5131 | | |
5132 | 5132 | | |
| 5133 | + | |
5133 | 5134 | | |
5134 | 5135 | | |
5135 | 5136 | | |
5136 | | - | |
5137 | | - | |
5138 | | - | |
5139 | 5137 | | |
5140 | 5138 | | |
5141 | 5139 | | |
| |||
0 commit comments