[mini.diff] compare with staged version? #1333
Replies: 3 comments 2 replies
-
I think there is some misunderstanding here. 'mini.diff' has a more general model than working only with Git: it has buffer (i.e. current) text and reference text. Two of them are compared with each other whenever each of them changes. How reference text is computed depends on the buffer source. You can read more here. The default source compares buffer's text with the text in the Git index, i.e. the text in the Git staging area, i.e. staged version of the file. Here are a bit more details.
Staging hunk means adding it to the index. This means that the text version in the buffer and in the reference text are the same. As there is no difference, there is no diff hunk to act (show, navigate, etc.) upon. Hence nothing is shown (in sign/number column, in overlay, etc.) Does this clarify things about how 'mini.diff' works? |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Thx, I really appreciate you taking the time to look at this.
To be honest, Gitsigns has the same problem (not updating the UI after applying a hunk). The problem there is luv: Maybe this is OpenBSD related. I don't want to bother you with stuff you're not using.... |
Beta Was this translation helpful? Give feedback.
-
Currently, mini.diff compares files with their committed version.
Is it possible to compare files with their staged version?
Background:
Sometimes I skim over the changes (
]h
) and stage everything I'd like to commit (gh
). As of now, there is no indication in the sign column, whether a hunk is staged or not. Would it be possible to have different signs or colors for modified/staged hunks?Btw: thanks for mini.diff. I switched to it from gitsigns :-)
Beta Was this translation helpful? Give feedback.
All reactions