mirror of
https://github.com/doomemacs/doomemacs
synced 2025-09-02 14:53:38 -05:00
bump: :ui
Alexander-Miller/treemacs@abd27c86df -> Alexander-Miller/treemacs@5fa8419950 Bad-ptr/persp-mode.el@40e9993a97 -> Bad-ptr/persp-mode.el@f146ddccaf dgutov/diff-hl@9b032018fd -> dgutov/diff-hl@39f076efa8 doomemacs/themes@729ad03463 -> doomemacs/themes@3152c60bb5 jaypei/emacs-neotree@4a4cd85761 -> jaypei/emacs-neotree@3178805a09 jdtsmith/indent-bars@87729d685d -> jdtsmith/indent-bars@aa07a3d812 jdtsmith/ultra-scroll@b447044b9d -> jdtsmith/ultra-scroll@8c92a17743 minad/goggles@5176114e99 -> minad/goggles@791140df23 seagle0128/doom-modeline@a85cb28da8 -> seagle0128/doom-modeline@cb703c217e tarsius/hl-todo@7ed8bbcadb -> tarsius/hl-todo@b8be53068b Includes some refactors to the workspaces and vc-gutter modules to adapt to upstream changes in persp-mode and diff-hl.
This commit is contained in:
@@ -75,23 +75,6 @@ Respects `diff-hl-disable-on-remote'."
|
||||
(file-remote-p default-directory))
|
||||
(diff-hl-dired-mode +1))))
|
||||
|
||||
;; HACK: diff-hl won't be visible in TTY frames, but there's no simple way to
|
||||
;; use the fringe in GUI Emacs *and* use the margin in the terminal *AND*
|
||||
;; support daemon users, so we need more than a static `display-graphic-p'
|
||||
;; check at startup.
|
||||
(if (not (daemonp))
|
||||
(unless (display-graphic-p)
|
||||
(add-hook 'global-diff-hl-mode-hook #'diff-hl-margin-mode))
|
||||
(when (modulep! :os tty)
|
||||
(put 'diff-hl-mode 'last t)
|
||||
(add-hook! 'doom-switch-window-hook
|
||||
(defun +vc-gutter-use-margins-in-tty-h ()
|
||||
(when (bound-and-true-p global-diff-hl-mode)
|
||||
(let ((graphic? (display-graphic-p)))
|
||||
(unless (eq (get 'diff-hl-mode 'last) graphic?)
|
||||
(diff-hl-margin-mode (if graphic? -1 +1))
|
||||
(put 'diff-hl-mode 'last graphic?))))))))
|
||||
|
||||
:config
|
||||
(set-popup-rule! "^\\*diff-hl" :select nil)
|
||||
|
||||
@@ -120,12 +103,17 @@ Respects `diff-hl-disable-on-remote'."
|
||||
:n "S" #'diff-hl-show-hunk-stage-hunk))
|
||||
;; UX: Refresh gutter in the selected buffer on ESC, switching windows, or
|
||||
;; refocusing the frame.
|
||||
(defvar-local +vc-gutter--last-state nil)
|
||||
(add-hook! '(doom-escape-hook doom-switch-window-hook doom-switch-frame-hook) :append
|
||||
(defun +vc-gutter-update-h (&rest _)
|
||||
"Return nil to prevent shadowing other `doom-escape-hook' hooks."
|
||||
(ignore (and (or (bound-and-true-p diff-hl-mode)
|
||||
(bound-and-true-p diff-hl-dir-mode))
|
||||
(diff-hl-update-once)))))
|
||||
(or (null +vc-gutter--last-state)
|
||||
(not (equal +vc-gutter--last-state
|
||||
(symbol-plist (intern (expand-file-name buffer-file-name)
|
||||
vc-file-prop-obarray)))))
|
||||
(diff-hl-update)))))
|
||||
;; UX: Update diff-hl when magit alters git state.
|
||||
(when (modulep! :tools magit)
|
||||
(add-hook 'magit-post-refresh-hook #'diff-hl-magit-post-refresh))
|
||||
@@ -182,10 +170,8 @@ Respects `diff-hl-disable-on-remote'."
|
||||
delay-mode-hooks
|
||||
(null (buffer-file-name (buffer-base-buffer)))
|
||||
(null (get-buffer-window (current-buffer))))
|
||||
(if (and diff-hl-update-async
|
||||
(not
|
||||
(run-hook-with-args-until-success 'diff-hl-async-inhibit-functions
|
||||
default-directory)))
|
||||
(setq diff-hl-timer nil)
|
||||
(if (diff-hl--use-async-p)
|
||||
(progn
|
||||
(+vc-gutter--kill-thread)
|
||||
(setq +vc-gutter--diff-hl-thread
|
||||
@@ -197,11 +183,11 @@ Respects `diff-hl-disable-on-remote'."
|
||||
(diff-hl--update))
|
||||
t))
|
||||
|
||||
(defadvice! +vc-gutter--only-tick-on-success-a (&rest _)
|
||||
:override #'diff-hl-update-once
|
||||
(unless (equal diff-hl--modified-tick (buffer-chars-modified-tick))
|
||||
(when (diff-hl-update)
|
||||
(setq diff-hl--modified-tick (buffer-chars-modified-tick)))))
|
||||
;; (defadvice! +vc-gutter--only-tick-on-success-a (&rest _)
|
||||
;; :override #'diff-hl-update-once
|
||||
;; (unless (equal diff-hl--modified-tick (buffer-chars-modified-tick))
|
||||
;; (when (diff-hl-update)
|
||||
;; (setq diff-hl--modified-tick (buffer-chars-modified-tick)))))
|
||||
|
||||
;; HACK: This advice won't work in *all* cases (it's a C function, and any
|
||||
;; calls to it from C won't trigger advice), but the thread issues above are
|
||||
|
@@ -1,4 +1,4 @@
|
||||
;; -*- no-byte-compile: t; -*-
|
||||
;;; ui/vc-gutter/packages.el
|
||||
|
||||
(package! diff-hl :pin "9b032018fda8eb6c241bba1ec0e5c354ad523b2c")
|
||||
(package! diff-hl :pin "39f076efa85110c4bcc9b73994f30a7d52312c98")
|
||||
|
Reference in New Issue
Block a user