nit(vc-gutter): reformat annotated comments

This commit is contained in:
Henrik Lissner 2022-09-06 23:41:28 +02:00
parent 48369fb654
commit 3ae8c520d5
No known key found for this signature in database
GPG key ID: B60957CA074D39A3

View file

@ -19,10 +19,10 @@
(setq-default fringes-outside-margins t) (setq-default fringes-outside-margins t)
;; STYLE: Redefine fringe bitmaps to take up only half the horizontal space in ;; STYLE: Redefine fringe bitmaps to take up only half the horizontal space in
;; the fringe. This way we avoid overbearingly large diff bars without having ;; the fringe. This way we avoid overbearingly large diff bars without
;; to shrink the fringe and sacrifice precious space for other fringe ;; having to shrink the fringe and sacrifice precious space for other fringe
;; indicators (like flycheck or flyspell). ;; indicators (like flycheck or flyspell).
;; TODO Extract these into a package with faces that themes can target. ;; REVIEW: Extract these into a package with faces that themes can target.
(if (not (modulep! +diff-hl)) (if (not (modulep! +diff-hl))
(after! git-gutter-fringe (after! git-gutter-fringe
(define-fringe-bitmap 'git-gutter-fr:added [224] (define-fringe-bitmap 'git-gutter-fr:added [224]
@ -54,7 +54,7 @@
;; FIX: To minimize overlap between flycheck indicators and git-gutter/diff-hl ;; FIX: To minimize overlap between flycheck indicators and git-gutter/diff-hl
;; indicators in the left fringe. ;; indicators in the left fringe.
(after! flycheck (after! flycheck
;; let diff have left fringe, flycheck can have right fringe ;; Let diff-hl have left fringe, flycheck can have right fringe
(setq flycheck-indication-mode 'right-fringe) (setq flycheck-indication-mode 'right-fringe)
;; A non-descript, left-pointing arrow ;; A non-descript, left-pointing arrow
(define-fringe-bitmap 'flycheck-fringe-bitmap-double-arrow (define-fringe-bitmap 'flycheck-fringe-bitmap-double-arrow
@ -101,8 +101,8 @@ is deferred until the file is saved. Respects `git-gutter:disabled-modes'."
;; UX: Disable in Org mode, as per syl20bnr/spacemacs#10555 and ;; UX: Disable in Org mode, as per syl20bnr/spacemacs#10555 and
;; syohex/emacs-git-gutter#24. Apparently, the mode-enabling function for ;; syohex/emacs-git-gutter#24. Apparently, the mode-enabling function for
;; global minor modes gets called for new buffers while they are still in ;; global minor modes gets called for new buffers while they are still in
;; `fundamental-mode', before a major mode has been assigned. I don't know why ;; `fundamental-mode', before a major mode has been assigned. I don't know
;; this is the case, but adding `fundamental-mode' here fixes the issue. ;; why this is the case, but adding `fundamental-mode' here fixes the issue.
(setq git-gutter:disabled-modes '(fundamental-mode image-mode pdf-view-mode)) (setq git-gutter:disabled-modes '(fundamental-mode image-mode pdf-view-mode))
:config :config
(set-popup-rule! "^\\*git-gutter" :select nil :size '+popup-shrink-to-fit) (set-popup-rule! "^\\*git-gutter" :select nil :size '+popup-shrink-to-fit)
@ -130,9 +130,8 @@ is deferred until the file is saved. Respects `git-gutter:disabled-modes'."
(advice-add #'magit-stage-file :after #'+vc-gutter-update-h) (advice-add #'magit-stage-file :after #'+vc-gutter-update-h)
(advice-add #'magit-unstage-file :after #'+vc-gutter-update-h) (advice-add #'magit-unstage-file :after #'+vc-gutter-update-h)
;; FIX: stop git-gutter:{next,previous}-hunk from jumping to random hunks.
(defadvice! +vc-gutter--fix-linearity-of-hunks-a (diffinfos is-reverse) (defadvice! +vc-gutter--fix-linearity-of-hunks-a (diffinfos is-reverse)
"FIX: `git-gutter:next-hunk' and `git-gutter:previous-hunk' sometimes
jumping to random hunks."
:override #'git-gutter:search-near-diff-index :override #'git-gutter:search-near-diff-index
(cl-position-if (let ((lineno (line-number-at-pos)) (cl-position-if (let ((lineno (line-number-at-pos))
(fn (if is-reverse #'> #'<))) (fn (if is-reverse #'> #'<)))
@ -191,7 +190,7 @@ is deferred until the file is saved. Respects `git-gutter:disabled-modes'."
(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 ;; 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. ;; reverting 2 lines or 20. This resizes the popup to match its contents.
(defadvice! +vc-gutter--shrink-popup-a (fn &rest args) (defadvice! +vc-gutter--shrink-popup-a (fn &rest args)
:around #'diff-hl-revert-hunk-1 :around #'diff-hl-revert-hunk-1
(letf! ((refine-mode diff-auto-refine-mode) (letf! ((refine-mode diff-auto-refine-mode)