merge: pull request #6369 from elken/feature/editor-format-refactor

This commit is contained in:
Henrik Lissner 2023-09-14 01:19:01 +02:00 committed by GitHub
commit a234d8e9c0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
89 changed files with 526 additions and 728 deletions

View file

@ -116,6 +116,11 @@ is deferred until the file is saved. Respects `git-gutter:disabled-modes'."
;; UX: update git-gutter on focus (in case I was using git externally)
(add-hook 'focus-in-hook #'git-gutter:update-all-windows)
;; Stop git-gutter doing things when we don't want
(remove-hook 'post-command-hook #'git-gutter:post-command-hook)
(advice-remove #'quit-window #'git-gutter:quit-window)
(advice-remove #'switch-to-buffer #'git-gutter:switch-to-buffer)
(add-hook! '(doom-escape-hook doom-switch-window-hook) :append
(defun +vc-gutter-update-h (&rest _)
"Refresh git-gutter on ESC. Return nil to prevent shadowing other
@ -130,6 +135,9 @@ 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-unstage-file :after #'+vc-gutter-update-h)
;; UX: update git-gutter after reverting a buffer
(add-hook 'after-revert-hook #'+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)
:override #'git-gutter:search-near-diff-index