feat(vc-gutter): shrink revert-hunk popup to contents
This commit is contained in:
parent
2ff8228133
commit
d55d7f3088
1 changed files with 12 additions and 0 deletions
|
@ -190,6 +190,18 @@ is deferred until the file is saved. Respects `git-gutter:disabled-modes'."
|
||||||
(add-hook 'magit-pre-refresh-hook #'diff-hl-magit-pre-refresh)
|
(add-hook 'magit-pre-refresh-hook #'diff-hl-magit-pre-refresh)
|
||||||
(add-hook 'magit-post-refresh-hook #'diff-hl-magit-post-refresh))
|
(add-hook 'magit-post-refresh-hook #'diff-hl-magit-post-refresh))
|
||||||
|
|
||||||
|
;; FIX: The revert popup consumes 50% of the frame, whether or not you're
|
||||||
|
;; reverting 2 lines or 20. This fix resizes the popup to match its contents.
|
||||||
|
(defadvice! +vc-gutter--shrink-popup-a (fn &rest args)
|
||||||
|
:around #'diff-hl-revert-hunk-1
|
||||||
|
(letf! ((refine-mode diff-auto-refine-mode)
|
||||||
|
(diff-auto-refine-mode t)
|
||||||
|
(defun diff-refine-hunk ()
|
||||||
|
(when refine-mode
|
||||||
|
(funcall diff-refine-hunk))
|
||||||
|
(shrink-window-if-larger-than-buffer)))
|
||||||
|
(apply fn args)))
|
||||||
|
|
||||||
;; UX: Don't delete the current hunk's indicators while we're editing
|
;; UX: Don't delete the current hunk's indicators while we're editing
|
||||||
(add-hook! 'diff-hl-flydiff-mode-hook
|
(add-hook! 'diff-hl-flydiff-mode-hook
|
||||||
(defun +vc-gutter-init-flydiff-mode-h ()
|
(defun +vc-gutter-init-flydiff-mode-h ()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue