mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
fix(format): handle git-gutter nicely
This commit is contained in:
@ -33,17 +33,16 @@ select buffers.")
|
||||
(funcall orig-fn)))
|
||||
|
||||
(add-hook! 'apheleia-post-format-hook
|
||||
;; HACK `web-mode' doesn't update syntax highlighting after arbitrary buffer
|
||||
;; modifications, so we must trigger refontification manually.
|
||||
(defun +format--fix-web-mode-fontification-h ()
|
||||
(when (eq major-mode 'web-mode)
|
||||
(setq web-mode-fontification-off nil)
|
||||
(when (and web-mode-scan-beg web-mode-scan-end global-font-lock-mode)
|
||||
(save-excursion
|
||||
(font-lock-fontify-region web-mode-scan-beg web-mode-scan-end)))))
|
||||
(defun +format--refresh-git-gutter-h ()
|
||||
(when (bound-and-true-p git-gutter-mode)
|
||||
(git-gutter))))
|
||||
;; HACK `web-mode' doesn't update syntax highlighting after arbitrary buffer
|
||||
;; modifications, so we must trigger refontification manually.
|
||||
(defun +format--fix-web-mode-fontification-h ()
|
||||
(when (eq major-mode 'web-mode)
|
||||
(setq web-mode-fontification-off nil)
|
||||
(when (and web-mode-scan-beg web-mode-scan-end global-font-lock-mode)
|
||||
(save-excursion
|
||||
(font-lock-fontify-region web-mode-scan-beg web-mode-scan-end)))))
|
||||
(defun +format--refresh-git-gutter-h ()
|
||||
(+vc-gutter-init-maybe-h)))
|
||||
|
||||
|
||||
;;
|
||||
|
Reference in New Issue
Block a user