Previously when diffing two files where one did not have a newline at
the end of the file, gitsigns was unable to stage such differences since
this information was not captured during the diff stage.
If you run `vim.diff('a', 'a\n')` you get the result:
@@ -1 +1 @@
-a
\ No newline at end of file
+a
However if you run `vim.diff('a', 'a\n', {result_type='indices'})` you
get:
{ {1, 1, 1, 1} }
And since Gitsigns tracks changes as a list of text lines, the
information about a missing newline at the end of the file is not
correctly tracked.
The main consequence of this is that staging hunks which contain these
lines would result in an error as the generated patch would not apply
since it was missing "\ No newline at end of file".
To fix this, the internal hunk object now tracks this end of file
information and patches are now generated correctly.
- Deprecated `next_hunk()` and `prev_hunk()`.
- Can now navigate to the first/last hunk using `nav_hunk('first'|'last')`.
- Added `count` to navigation options. Defaults to `v:count1`.
- Updated recommended keymaps for navigation.
- Navigation actions now navigate to the first non-blank column.
The default text sign for add and change is a "Box Drawings Heavy
Vertical" (U+2503). However, README.md uses "Box Drawings Light
Vertical" (U+2502) in its configuration for these signs. This
commit changes the sample configuration to match the actual defaults
used in the code, which then gets propagated to gitsigns.txt when
running gen_help.lua.
This way someone who wants to use the same symbol for untracked as add
and change, as I did, gets the same character when they copy and paste
from the documentation into their config.
- Avoid emitting errors when the version check fails.
- Put version checking into separate module.
- Pull in upstream changes for vim.system.
Fixes: #948Closes: #960
Since linematch will report a changed line following deleted lines as
multiple hunks on a single line, it will only show the `changed` sign
and will drop the `deleted` sign. To fix this check for overlapping
hunks and mark the change hunk as changedelete.