branch: externals/diff-hl commit a4913bb3ef54efe52990cbcd0a20ce6cc5235fba Author: Dmitry Gutov <dmi...@gutov.dev> Commit: Dmitry Gutov <dmi...@gutov.dev>
Reduce blinkiness during show-hunk's next/previous jumps * Don't call diff-hl-show-hunk--posframe-hide when (re)showing hunk, let the rendering code take care of that. * Move point to beginning of indentation in diff-hl-show-hunk--goto-hunk-overlay. Less chance to trigger show-paren-mode highlights, and a more logical position anyway. * Don't select-frame-set-input-focus at the end of diff-hl-show-hunk-posframe. Removes the cursor blink between the frames, while keys and button pressed still get processed the same. --- diff-hl-show-hunk-posframe.el | 4 +--- diff-hl-show-hunk.el | 7 ++----- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/diff-hl-show-hunk-posframe.el b/diff-hl-show-hunk-posframe.el index f5f24e2ee3..9f25c9e890 100644 --- a/diff-hl-show-hunk-posframe.el +++ b/diff-hl-show-hunk-posframe.el @@ -171,7 +171,6 @@ The button calls an ACTION." (user-error "Package `posframe' is not workable. Please customize diff-hl-show-hunk-function")) - (diff-hl-show-hunk--posframe-hide) (setq diff-hl-show-hunk--hide-function #'diff-hl-show-hunk--posframe-hide) ;; put an overlay to override read-only-mode keymap @@ -228,8 +227,7 @@ The button calls an ACTION." (setq cursor-type 'box) ;; Recenter around point - (recenter))) - (select-frame-set-input-focus diff-hl-show-hunk--frame)) + (recenter)))) (provide 'diff-hl-show-hunk-posframe) ;;; diff-hl-show-hunk-posframe.el ends here diff --git a/diff-hl-show-hunk.el b/diff-hl-show-hunk.el index 3e82e10233..8f50b42004 100644 --- a/diff-hl-show-hunk.el +++ b/diff-hl-show-hunk.el @@ -338,7 +338,8 @@ end of the OVERLAY, so posframe/inline is placed below the hunk." (set-window-start nil (point))) ((> (point) pt) (redisplay)))) - (goto-char (1- (overlay-end overlay))))) + (goto-char (1- (overlay-end overlay))) + (forward-line 0))) ;;;###autoload (defun diff-hl-show-hunk-next () @@ -361,10 +362,6 @@ end of the OVERLAY, so posframe/inline is placed below the hunk." The backend is determined by `diff-hl-show-hunk-function'." (interactive) - ;; Close any previous hunk - (save-excursion - (diff-hl-show-hunk-hide)) - (unless (vc-backend buffer-file-name) (user-error "The buffer is not under version control"))