If a file is subject to a clean/smudge filter, it is impossible to stage
an individual hunk. Therefore if the user tries to stage a hunk, ask
whether they want to stage the entire instead.
Determining whether a clean/smudge filter applies is done with:
git check-attr filter -- path/to/file
– and looking for "unspecified" (not to be) in the output. The result
is cached so that for a file which is not filtered (the common case),
staging multiple hunks only incurs the cost of the external call once.
See #796.
This only applies to floating preview windows on Neovim.
Handles the following way of closing the floating preview:
- <Esc>
- Moving cursor
- 2<C-W>c (where 2 is the floating window's window number)
- <C-W><C-W> to move into and out of the floating window
Closes#786.
This bug was introduced by 9784226 in #708. It had the effect of not
allowing an existing hunk preview window to increase in size for a
larger hunk (up to 'previewheight').
See #775.
I would prefer to remove the statusline altogether in the hunk preview
window, making it consistent with the floating preview window. However
I do not think that is possible; the best one can do is make it blank.
When previewing a hunk we re-use any existing preview window. However
we need to reset it for our purposes in case it was used in an
incompatible way before.
See #713.
win_getid() was introduced in Vim 7.4.1557. The code uses it to
remember the id of the preview window. In newer Vims or Neovim this
could be a floating window but pre-7.4.1557 it can only be an ordinary
preview window. And in that case we only need the preview window's
buffer number.
This commit uses the buffer number when win_getid() isn't available.
Fixes#683.
matchaddpos() has better backward compatibility than text properties. I
only used text properties inside Vim popups because I did not think
there was a way to use matchaddpos(), but then I found a way.