Open zw963 opened 2 years ago
Hi!
I can reproduce this, I think. Though I think the actual scenario is a little more complicated: you first have to have tested with (setq diff-hl-show-staged-changes nil)
, and then with (setq diff-hl-show-staged-changes t)
again.
Does the below help, or are we talking about different scenarios?
diff --git a/diff-hl-show-hunk.el b/diff-hl-show-hunk.el
index 00f6d92..42c3523 100644
--- a/diff-hl-show-hunk.el
+++ b/diff-hl-show-hunk.el
@@ -342,7 +342,9 @@ end of the OVERLAY, so posframe/inline is placed below the hunk."
(defun diff-hl-show-hunk-next ()
"Go to next hunk/change and show it."
(interactive)
- (let* ((point (if diff-hl-show-hunk--original-overlay
+ (let* ((point (if (and
+ diff-hl-show-hunk--original-buffer
+ diff-hl-show-hunk--original-overlay)
(overlay-start diff-hl-show-hunk--original-overlay)
nil))
(next-overlay (diff-hl-show-hunk--next-hunk nil point)))
If it does not, or if the fix doesn't seem enough for you, what if after step 5 you refresh the highlightings with M-x revert-buffer
? Does the next step look consistent to you?
Does the below help, or are we talking about different scenarios?
Yes, i consider behavior is almost same for now, though, there still exists some issue, will describe later.
After run git add diff-hl.el
successful, and jump to beginning-of-buffer.
C-x v ]
, cursor jump to line 181, like this.
Or
C-x v }
, cursor jump to line 191, and we can see "no next hunk` on minibuffer.
So, i thought we have two issue:
C-x v ]
is jump to line 181, C-x v }
jump to line 191, they use different logic i guess, that not good. (this is consider as a new issue) ?
C-x v ]
can be jump continuously with ] when enable repeat mode, C-x v }
do it same way for now, but, with a "no next hunk" error message, but can jump continuously anyway.
This issue still exists, simply to say, current git status is modifed status:
## master
M deploy_start.sh
C+v] can jump to next hunk, but (diff-hl-show-hunk-next) can not.
I don't know which command is work correct, but if one work correct, i guess another one must be incorrect.
Following is a reproduce:
we assume a
Gemfile
exists some different.restart emacs as daemon, and open Gemfile use emacs client
switch to beginning of buffer.
Both
C-x v ]
andC-x v }
can jump to the difference as expect.run
git add Gemfie
on command lineC-x v ]
can jump, butC-x v }
not jump, message: There is no next change Question 1: which command is correct?When i set (setq diff-hl-show-staged-changes nil), not jump is correct, right?
run
git reset
on command linebehavior same as 6, in this case, jump is correct, right?
I assume diff-hl check the git operation from command line is not so easy, e.g. when i do staging from command line successful, i still see the fringe indicate exists diff on this line.
though, that maybe another issue,
but, this issue focus on above two command should not behavior different in this case.
Thank you.