parent
d309dcad27
commit
e59023b843
1 changed files with 16 additions and 1 deletions
|
@ -193,4 +193,19 @@ Respects `diff-hl-disable-on-remote'."
|
||||||
(defadvice! +vc-gutter--kill-diff-hl-thread-a (&optional buf)
|
(defadvice! +vc-gutter--kill-diff-hl-thread-a (&optional buf)
|
||||||
:before #'kill-buffer
|
:before #'kill-buffer
|
||||||
(with-current-buffer (or buf (current-buffer))
|
(with-current-buffer (or buf (current-buffer))
|
||||||
(+vc-gutter--kill-thread t))))
|
(+vc-gutter--kill-thread t)))
|
||||||
|
|
||||||
|
;; 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.
|
||||||
|
(when (modulep! :os tty)
|
||||||
|
(put 'diff-hl-mode 'last (display-graphic-p))
|
||||||
|
(add-hook! 'doom-switch-window-hook
|
||||||
|
(defun +vc-gutter-use-margins-in-tty-h ()
|
||||||
|
(let ((graphic? (display-graphic-p)))
|
||||||
|
(unless (and global-diff-hl-mode (eq (get 'diff-hl-mode 'last) graphic?))
|
||||||
|
(global-diff-hl-mode -1)
|
||||||
|
(diff-hl-margin-mode (if graphic? -1 +1))
|
||||||
|
(global-diff-hl-mode +1)
|
||||||
|
(put 'diff-hl-mode 'last graphic?)))))))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue