Commit Graph

19 Commits

Author SHA1 Message Date
Lewis Russell
f10fddafe0 fix: more EOL fixes
- When staging files, convert the text into a string before passing to
  system() to ensure EOL is respected.
- When setting lines. If text doesn't end with an empty line then set
  'eol=false'.

Fixes #1145
2025-01-20 12:27:57 +00:00
Lewis Russell
904108425c refactor: formatting 2025-01-09 09:15:26 +00:00
Lewis Russell
2eaa305373 ci: resolve failures
Some checks are pending
CI / doc (push) Waiting to run
CI / commit_lint (push) Waiting to run
CI / test (nightly) (push) Waiting to run
CI / test (v0.10.0) (push) Waiting to run
CI / test (v0.9.5) (push) Waiting to run
CI / lint (push) Waiting to run
release-please / release-please (push) Waiting to run
release-please / luarocks-upload (push) Blocked by required conditions
release-please / update-doc (push) Blocked by required conditions
2025-01-08 14:08:46 +00:00
Lewis Russell
11cb53391b refactor(git): remove some code 2024-07-03 11:50:20 +01:00
Lewis Russell
c02516144a
refacto: misc refactoring (#983) 2024-04-16 17:27:19 +01:00
Lewis Russell
c097cb2550 fix(stage): staging of files with no nl at eof
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.
2024-04-10 15:53:16 +01:00
Lewis Russell
ade22fc9b9 chore: format 2024-04-05 14:21:10 +01:00
Lewis Russell
ee5b6ba0b5 fix(nav): followup for #976 2024-04-05 13:52:40 +01:00
Lewis Russell
1389134ba9 fix: trigger GitSignsUpdate autocmd more often
Resolves #831 #832
2024-04-04 11:40:34 +01:00
Lewis Russell
2b96835a2b fix(actions): prev_hunk works with wrap on line 1
Fixes #806
2024-04-04 11:00:03 +01:00
Lewis Russell
096d0833f7 test: migrate to nvim-test 2024-04-03 16:56:07 +01:00
Lewis Russell
ff01d34daa test: more tidying 2023-10-06 09:04:46 +01:00
Lewis Russell
2929386210 chore: stylua test code 2023-10-05 16:25:10 +01:00
Lewis Russell
fbc42056b4 feat: enable extmark signs by default 2023-10-05 16:25:10 +01:00
Lewis Russell
e2ca739be7 test: speed up some tests 2023-10-01 11:47:47 +01:00
Lewis Russell
a56fb7cc42 refactor(tests): tidy up 2023-06-19 12:46:25 +01:00
Lewis Russell
4bbfb06cf7 fix: vendor testsuite 2023-06-13 15:32:14 +01:00
Lewis Russell
498abfa13d refactor: OOP signs 2022-04-19 16:25:32 +01:00
Lewis Russell
f362e54e11 feat(actions): true partial hunk staging
Resolves #338
2021-12-04 18:38:52 +00:00