Commit Graph

26 Commits

Author SHA1 Message Date
Lewis Russell
2e85a2a9ec ci: fix luals errors and check in ci 2025-01-20 10:15:14 +00:00
Lewis Russell
2b6c069cb4 refactor: update async.lua 2025-01-09 09:15:26 +00:00
Lewis Russell
863903631e fix: string.buffer not found
Fixes 
2024-09-27 09:14:46 +01:00
Lewis Russell
233bcbfda3 feat: use luajit buffers to serialize thread data 2024-09-26 11:18:12 +01:00
Lewis Russell
82bc6225e9 refactor: organize imports 2024-07-03 12:08:06 +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
4e90cf984c feat(actions): add callback to async actions
- simplify async code

Fixes: , 
2024-04-03 11:30:19 +01:00
Lewis Russell
8aedc8b15a feat(diffopt): add support for whitespace flags in diffopt
Resolves 
2023-10-02 11:22:42 +01:00
Lewis Russell
ac922e1785 fix(dos): remove incorrect CR
Fixes 
2023-09-23 15:18:14 +01:00
Lewis Russell
79127db3b1 fix(diff): better handling of final newline
Fixes 
2023-08-25 13:32:03 +01:00
Lewis Russell
55f8fc7b13 fix: typing 2023-08-15 13:28:36 +01:00
Lewis Russell
0daf763ed7 chore: run through stylua 2023-07-10 11:17:40 +01:00
Lewis Russell
92654646f8 refactor: post teal-pocolypse cleanup
- assume vim.iconv
2023-06-14 12:02:18 +01:00
Lewis Russell
4d63d996b0 refactor: remove teal 2023-06-13 15:32:14 +01:00
Lewis Russell
8ad98db42a feat: add comments to generated lua files 2023-02-16 11:09:17 +00:00
Lewis Russell
8164179143 feat: remove FFI diff implementation 2023-01-03 15:27:43 +00:00
Lewis Russell
88d7aae293 feat(diff): support for linematch
Requires https://github.com/neovim/neovim/pull/14537
2022-11-04 10:05:20 +00:00
Lewis Russell
9110ea15a1 feat(preview): add preview_hunk_inline() 2022-10-29 11:56:14 +01:00
Lewis Russell
18b5523e38 build: update Teal to 0.14.1 2022-08-31 15:07:42 +01:00
Lewis Russell
18bffcadd5 feat(diff): run xdiff on a separate thread
Requires https://github.com/neovim/neovim/pull/15658
2022-04-11 09:17:15 +01:00
Lewis Russell
11425117a9 refactor(diff): make word diff more efficient
Resolves 
2022-02-07 13:03:09 +00:00
Lewis Russell
b4548e4c60 refactor(highlights)!: rework highlights
- Added GitSigns*Inline and GitSigns*LnInline to be used with word diff
    - GitSigns*LnInline is used for word diff with config.word_diff
    - GitSigns*Inline is used for word diff in hunk previews

- Added GitSigns*VirtLn and GitSigns*VirtLnInline to be used with
  `config.show_deleted`.

- Define GitSigns highlights conditionally as opposed to only defining
  them if certain features are enabled.
2022-01-26 17:33:24 +00:00
Lewis Russell
f362e54e11 feat(actions): true partial hunk staging
Resolves 
2021-12-04 18:38:52 +00:00
Lewis Russell
805b12a9b7 chore(refactor): refactor Hunk object
So added and removed lines are kept in separate tables
2021-09-27 13:11:12 +01:00
Lewis Russell
34deec2813 Add config.diff_opts and deprecate fields
- DEPRECATED diff_algorithm
    replaced with diff_opts.algorithm

- DEPRECATED use_internal_diff
    replaced with diff_opts.internal

- ADDED diff_opts.indent_heuristic
2021-09-09 13:58:07 +01:00
Lewis Russell
1ddb1f64f5 Add support for vim.xdl_diff
Requires PR neovim/neovim/#14536
2021-08-23 12:43:21 +01:00