This is to avoid side effects caused by switching to the buffer to be
written and back again.
It also means that the plugin can process any buffer without having to
make it the current buffer.
Using the lower level writefile() function means we have to deal with
line endings. It might also mean we have to deal with (file) encodings
but I hope not...
See #463, #466.
- Treat &previewheight as a maximum height.
- Make preview window shrink to fit the hunk.
- Resize preview window each time.
- Make preview window readonly and nomodifiable.
Based on code by @somini. Thanks!
See #451.
- Hunk stage/undo/preview no longer saves the buffer.
- Hunk undo no longer makes locations go out of sync.
- Grep can be opted out of (grep output with ansi escapes is number one cause
of issues).
- Replaced g:gitgutter_grep_command with g:gitgutter_grep.
- Always runs git-diff the same way instead of in two possible ways.
- Separated detection of git tracking from diffing.
- Simplified path handling.
- Removed support for xolox shell: Windows taskbar does not flash with async
jobs.
- Removed g:gitgutter_{eager,realtime}.
- Simplified implementation generally.
When opening vim with multiple files, e.g. via `vim -o file1 file2`, Vim
fires a `BufEnter` event for each file. However the effective buffer
number (`<abuf>`) is always 1, instead of being each buffer's number in
turn, so we end up processing the first buffer n times instead of each
of n buffers once.
This commit is a brute force workaround to ensure all buffers are
processed if there is more than one.
Closes#428.
The previous implementation assumed that CTRL-Y and CTRL-E could scroll
by negative counts, i.e. in the opposite direction. It turns out they
cannot: they treat negative counts as positive ones and always scroll in
the same direction.
This meant that undoing a hunk in the top half of the screen caused the
screen to scroll.
Closes#394.
neovim/neovim#5529 merged support for Vim's partial functions, which
made nvim more strict about dictionary functions. This means the
implicit self variable isn't available unless a function is annoted as a
dict function or defined as part of a dictionary.
Closes#392