Henrik Lissner 2020-04-23 03:44:23 -04:00
parent 0837c56430
commit 6c7bd1a94a
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 28 additions and 26 deletions

View file

@ -27,24 +27,20 @@
:defer t
:init
(add-hook! 'doom-load-theme-hook :append
(defun +doom-solaire-mode-swap-bg-maybe-h ()
(defun +doom-solaire-swap-bg-faces-maybe-h ()
(when (string-prefix-p "doom-" (symbol-name doom-theme))
(require 'solaire-mode)
(solaire-mode-swap-bg))))
(solaire-mode-swap-bg)))
#'solaire-global-mode)
:config
;; fringe can become unstyled when deleting or focusing frames
(add-hook 'focus-in-hook #'solaire-mode-reset)
;; Prevent color glitches when reloading either DOOM or loading a new theme
(add-hook! '(doom-load-theme-hook doom-reload-hook) :append
#'solaire-mode-reset)
;; org-capture takes an org buffer and narrows it. The result is erroneously
;; considered an unreal buffer, so solaire-mode must be restored.
(add-hook 'org-capture-mode-hook #'turn-on-solaire-mode)
;; On Emacs 26+, when point is on the last line and solaire-mode is remapping
;; the hl-line face, hl-line's highlight bleeds into the rest of the window
;; after eob. On Emacs 27 this no longer happens.
(unless EMACS27+
;; On Emacs <=26, when point is on the last line and solaire-mode is
;; remapping the hl-line face, hl-line's highlight bleeds into the rest of
;; the window after eob. On Emacs 27 this no longer happens.
(defun +doom--line-range-fn ()
(let ((bol (line-beginning-position))
(eol (line-end-position))
@ -57,21 +53,27 @@
(= eol pmax))
eol)
((line-beginning-position 2))))))
(setq hl-line-range-function #'+doom--line-range-fn))
(setq hl-line-range-function #'+doom--line-range-fn)
;; Because fringes can't be given a buffer-local face, they can look odd, so
;; we remove them in the minibuffer and which-key popups (they serve no
;; purpose there anyway).
(add-hook! 'solaire-mode-hook
(defun +doom-disable-fringes-in-minibuffer-h (&rest _)
(set-window-fringes (minibuffer-window) 0 0 nil)))
;; HACK The fringe cannot have a buffer-local remapping on Emacs <= 26, so
;; we jump through hoops to reset it (globally) whenever it is likely
;; that the fringe will have lost its background color.
;; Prevent color glitches when reloading either DOOM or loading a new theme
(add-hook! '(doom-load-theme-hook doom-reload-hook) :append
#'solaire-mode-reset)
(defadvice! +doom--no-fringes-in-which-key-buffer-a (&rest _)
:after 'which-key--show-buffer-side-window
(+doom-disable-fringes-in-minibuffer-h)
(set-window-fringes (get-buffer-window which-key--buffer) 0 0 nil))
;; fringe can become unstyled when deleting or focusing frames
(add-hook 'focus-in-hook #'solaire-mode-reset)
(add-hook! '(minibuffer-setup-hook window-configuration-change-hook)
#'+doom-disable-fringes-in-minibuffer-h)
(solaire-global-mode +1))
;; A global fringe color means the minibuffer (with its fringes) will always
;; stand out, so we remove them (in which-key popups too).
(add-hook! 'solaire-mode-hook
(defun +doom-disable-fringes-in-minibuffer-h (&rest _)
(set-window-fringes (minibuffer-window) 0 0 nil)))
(defadvice! +doom--no-fringes-in-which-key-buffer-a (&rest _)
:after 'which-key--show-buffer-side-window
(+doom-disable-fringes-in-minibuffer-h)
(set-window-fringes (get-buffer-window which-key--buffer) 0 0 nil))
(add-hook! '(minibuffer-setup-hook window-configuration-change-hook)
#'+doom-disable-fringes-in-minibuffer-h)))

View file

@ -2,4 +2,4 @@
;;; ui/doom/packages.el
(package! doom-themes :pin "8d5ddbbb72")
(package! solaire-mode :pin "4ac324ccb0")
(package! solaire-mode :pin "adc8c0c60d")