From 04641d56437d5aedd3c3f8ca0ba1b87c57f6e1fb Mon Sep 17 00:00:00 2001 From: Vincent Zhang Date: Thu, 21 Jun 2018 15:45:42 +0800 Subject: [PATCH 1/5] Fix typo. --- doom-modeline.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doom-modeline.el b/doom-modeline.el index 4d411da..b06831c 100644 --- a/doom-modeline.el +++ b/doom-modeline.el @@ -204,7 +204,7 @@ If STRICT-P, return nil if no project was found, otherwise return ;; anzu and evil-anzu expose current/total state that can be displayed in the ;; mode-line. -(when (feature 'evil-anzu) +(when (featurep 'evil-anzu) (setq anzu-cons-mode-line-p nil anzu-minimum-input-length 1 anzu-search-threshold 250) From 14e4b8ba5a187fc679f14d2837c8440791a436fd Mon Sep 17 00:00:00 2001 From: Vincent Zhang Date: Thu, 21 Jun 2018 17:40:00 +0800 Subject: [PATCH 2/5] Disable anzu modeline. --- doom-modeline.el | 1 + 1 file changed, 1 insertion(+) diff --git a/doom-modeline.el b/doom-modeline.el index b06831c..82245a5 100644 --- a/doom-modeline.el +++ b/doom-modeline.el @@ -735,6 +735,7 @@ lines are selected, or the NxM dimensions of a block selection." (defsubst doom-modeline--anzu () "Show the match index and total number thereof. Requires `anzu', also `evil-anzu' if using `evil-mode' for compatibility with `evil-search'." + (setq anzu-cons-mode-line-p nil) (when (and anzu--state (not iedit-mode)) (propertize (let ((here anzu--current-position) From 616fdabd8d7a48a174397c5e30eb52272f05d351 Mon Sep 17 00:00:00 2001 From: Vincent Zhang Date: Thu, 21 Jun 2018 18:31:16 +0800 Subject: [PATCH 3/5] Fix: set current window after switching window. --- doom-modeline.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doom-modeline.el b/doom-modeline.el index 82245a5..76e4297 100644 --- a/doom-modeline.el +++ b/doom-modeline.el @@ -243,17 +243,17 @@ If STRICT-P, return nil if no project was found, otherwise return (force-mode-line-update)) (add-hook 'window-configuration-change-hook #'doom-modeline-set-selected-window) -(add-hook 'doom-after-switch-window-hook #'doom-modeline-set-selected-window) +(add-hook 'switch-window-finish-hook #'doom-modeline-set-selected-window) (with-no-warnings (if (not (boundp 'after-focus-change-function)) (progn (add-hook 'focus-in-hook #'doom-modeline-set-selected-window) (add-hook 'focus-out-hook #'doom-modeline-unset-selected-window)) (defun doom-modeline-refresh-frame () - (setq +doom-modeline-current-window nil) + (setq doom-modeline-current-window nil) (cl-loop for frame in (frame-list) if (eq (frame-focus-state frame) t) - return (setq +doom-modeline-current-window (frame-selected-window frame))) + return (setq doom-modeline-current-window (frame-selected-window frame))) (force-mode-line-update)) (add-function :after after-focus-change-function #'doom-modeline-refresh-frame))) From 2beb80206a58ffbef69c183631a5697ca8e54fd0 Mon Sep 17 00:00:00 2001 From: Vincent Zhang Date: Thu, 21 Jun 2018 18:43:02 +0800 Subject: [PATCH 4/5] Fix: set current window after switching window via click. --- doom-modeline.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doom-modeline.el b/doom-modeline.el index 76e4297..e7fbac4 100644 --- a/doom-modeline.el +++ b/doom-modeline.el @@ -243,7 +243,8 @@ If STRICT-P, return nil if no project was found, otherwise return (force-mode-line-update)) (add-hook 'window-configuration-change-hook #'doom-modeline-set-selected-window) -(add-hook 'switch-window-finish-hook #'doom-modeline-set-selected-window) +(advice-add #'handle-switch-frame :after #'doom-modeline-set-selected-window) +(advice-add #'select-window :after #'doom-modeline-set-selected-window) (with-no-warnings (if (not (boundp 'after-focus-change-function)) (progn From e69364282cb1aa1364c576fbbebc0dec7c7cbeac Mon Sep 17 00:00:00 2001 From: Vincent Zhang Date: Thu, 21 Jun 2018 19:06:00 +0800 Subject: [PATCH 5/5] Update functions for icons. --- doom-modeline.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doom-modeline.el b/doom-modeline.el index e7fbac4..acb487c 100644 --- a/doom-modeline.el +++ b/doom-modeline.el @@ -364,17 +364,17 @@ active." (defun doom-modeline-maybe-icon-octicon (&rest args) "Display octicon via `ARGS'." - (when (and (featurep 'all-the-icons) (display-graphic-p) (not (eq system-type 'windows-nt))) + (when (display-graphic-p) (apply 'all-the-icons-octicon args))) (defun doom-modeline-maybe-icon-faicon (&rest args) "Display font awesome icon via `ARGS'." - (when (and (featurep 'all-the-icons) (display-graphic-p) (not (eq system-type 'windows-nt))) + (when (display-graphic-p) (apply 'all-the-icons-faicon args))) (defun doom-modeline-maybe-icon-material (&rest args) "Display material icon via `ARGS'." - (when (and (featurep 'all-the-icons) (display-graphic-p) (not (eq system-type 'windows-nt))) + (when (display-graphic-p) (apply 'all-the-icons-material args))) (defsubst doom-modeline--active ()