diff --git a/modules/ui/vc-gutter/config.el b/modules/ui/vc-gutter/config.el index d3d4948a4..bc40589b6 100644 --- a/modules/ui/vc-gutter/config.el +++ b/modules/ui/vc-gutter/config.el @@ -77,13 +77,13 @@ is deferred until the file is saved. Respects `git-gutter:disabled-modes'." (cond ((and (file-remote-p (or file-name default-directory)) (not +vc-gutter-in-remote-files))) - ;; If not a valid file, wait until it is written/saved to activate + ;; UX: If not a valid file, wait until it is written/saved to activate ;; git-gutter. ((not (and file-name (vc-backend file-name))) (add-hook 'after-save-hook #'+vc-gutter-init-maybe-h nil 'local)) - ;; Allow git-gutter or git-gutter-fringe to activate based on the type - ;; of frame we're in. This allows git-gutter to work for silly geese - ;; who open both tty and gui frames from the daemon. + ;; UX: Allow git-gutter or git-gutter-fringe to activate based on the + ;; type of frame we're in. This allows git-gutter to work for silly + ;; geese who open both tty and gui frames from the daemon. ((if (and (display-graphic-p) (require 'git-gutter-fringe nil t)) (setq-local git-gutter:init-function #'git-gutter-fr:init @@ -98,7 +98,7 @@ is deferred until the file is saved. Respects `git-gutter:disabled-modes'." (git-gutter-mode +1) (remove-hook 'after-save-hook #'+vc-gutter-init-maybe-h 'local))))))) - ;; 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 ;; 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 @@ -107,13 +107,13 @@ is deferred until the file is saved. Respects `git-gutter:disabled-modes'." :config (set-popup-rule! "^\\*git-gutter" :select nil :size '+popup-shrink-to-fit) - ;; Only enable the backends that are available, so it doesn't have to check - ;; when opening each buffer. + ;; PERF: Only enable the backends that are available, so it doesn't have to + ;; check when opening each buffer. (setq git-gutter:handled-backends (cons 'git (cl-remove-if-not #'executable-find (list 'hg 'svn 'bzr) :key #'symbol-name))) - ;; Update git-gutter on focus (in case I was using git externally) + ;; UX: update git-gutter on focus (in case I was using git externally) (add-hook 'focus-in-hook #'git-gutter:update-all-windows) (add-hook! '(doom-escape-hook doom-switch-window-hook) :append @@ -126,12 +126,12 @@ is deferred until the file is saved. Respects `git-gutter:disabled-modes'." (if git-gutter-mode (git-gutter) (+vc-gutter-init-maybe-h)))))) - ;; update git-gutter when using magit commands + ;; UX: update git-gutter when using magit commands (advice-add #'magit-stage-file :after #'+vc-gutter-update-h) (advice-add #'magit-unstage-file :after #'+vc-gutter-update-h) (defadvice! +vc-gutter--fix-linearity-of-hunks-a (diffinfos is-reverse) - "Fixes `git-gutter:next-hunk' and `git-gutter:previous-hunk' sometimes + "FIX: `git-gutter:next-hunk' and `git-gutter:previous-hunk' sometimes jumping to random hunks." :override #'git-gutter:search-near-diff-index (cl-position-if (let ((lineno (line-number-at-pos))