Replies: 1 comment
-
Both 'mini.diff' and 'lewis6991/gitsigns.nvim' use Neovim's With that said, there are several possible explanations here:
And here is an example of how similar changes look for me (with overlay enabled to see precisely which lines it thinks were changed; green/cyan line numbers are added/changed; dot in number column denotes virtual line): Here is the "before" (reference) and "after" (buffer) lines used for this:
A mild note: having both 'gitsigns.nvim' and 'mini.diff' enabled for a daily usage can result in hard to spot issues. It probably has nothing to do with this question, though.
Sorry, I didn't get that. Would you mind posting a relatively small example of "before" and "after" lines along with the result you get (and 'mini.diff' setup if it will differ from the already posted one). This way we can have a more meaningful discussion. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Contributing guidelines
Module(s)
mini.diff
Question
I am trying out mini.diff and I noticed that it has a very different idea of what is changed vs new from what I do. gitsigns and lualine are closer, though they're also not perfect.
It is of course a hard problem, as "changed" vs "some deleted and some new" is a semantic question, not a structural one, and most diff tools don't do semantics.
Here's a little example of what I'm talking about:

This shows the signs from gitsigns on the far left column and mini.diff next to it.
And here is an excerpt from
git diff
for that section (blank line at start is intentional, but this is not the start of a hunk):It seems like mini.diff is just treating a hunk as all changed if there's both - and + in it. Or something close to that - there is actually one line in this file for which mini.diff shows it as added, and it's right between some deleted stuff and some added stuff, though right after an unchanged non-whitespace line.
Anyway, I wanted to ask if it's intentional that it's so different. I haven't explored it enough to fully understand the behavior. If I add 121 lines and delete 48, I don't expect to see all the new lines except for one be counted as changed, so it's definitely confusing so far.
Beta Was this translation helpful? Give feedback.
All reactions