Fix #185: doom-modeline breaks query-replace.

This commit is contained in:
Vincent Zhang 2019-06-10 16:03:48 +08:00
parent 118f7084ff
commit 6293c63924

View file

@ -327,15 +327,16 @@ Uses `all-the-icons-material' to fetch the icon."
(defun doom-modeline-update-buffer-file-name (&rest _) (defun doom-modeline-update-buffer-file-name (&rest _)
"Update buffer file name in mode-line." "Update buffer file name in mode-line."
(setq doom-modeline--buffer-file-name (setq doom-modeline--buffer-file-name
(if buffer-file-name (save-match-data
(doom-modeline-buffer-file-name) (if buffer-file-name
(propertize "%b" (doom-modeline-buffer-file-name)
'face (if (doom-modeline--active) (propertize "%b"
'doom-modeline-buffer-file 'face (if (doom-modeline--active)
'mode-line-inactive) 'doom-modeline-buffer-file
'help-echo "Buffer name 'mode-line-inactive)
'help-echo "Buffer name
mouse-1: Previous buffer\nmouse-3: Next buffer" mouse-1: Previous buffer\nmouse-3: Next buffer"
'local-map mode-line-buffer-identification-keymap)))) 'local-map mode-line-buffer-identification-keymap)))))
(add-hook 'find-file-hook #'doom-modeline-update-buffer-file-name) (add-hook 'find-file-hook #'doom-modeline-update-buffer-file-name)
(add-hook 'after-revert-hook #'doom-modeline-update-buffer-file-name) (add-hook 'after-revert-hook #'doom-modeline-update-buffer-file-name)
(add-hook 'after-save-hook #'doom-modeline-update-buffer-file-name) (add-hook 'after-save-hook #'doom-modeline-update-buffer-file-name)