Fix #1311: remove project check in ivy transformer

Also: minor refactor of `cond` fallback blocks
This commit is contained in:
Henrik Lissner 2019-04-07 15:10:22 -04:00
parent 1fab389d9e
commit e60b44d255
No known key found for this signature in database
GPG Key ID: 5F6C0EA160557395

View File

@ -17,18 +17,11 @@
(defun +ivy-rich-buffer-name (candidate)
"Display the buffer name.
Displays buffers in other projects in `font-lock-doc-face', and
temporary/special buffers in `font-lock-comment-face'."
(propertize
candidate
'face (cond ((string-match-p "^ *\\*" candidate)
'font-lock-comment-face)
((not (buffer-file-name (get-buffer candidate)))
nil)
((not (projectile-project-buffer-p
(get-buffer candidate)
(doom-project-root)))
'font-lock-doc-face))))
Buffers that are considered unreal (see `doom-real-buffer-p') are dimmed with
`font-lock-comment-face'."
(if (doom-real-buffer-p (get-buffer candidate))
candidate
(propertize candidate 'face 'font-lock-comment-face)))
;;;###autoload
(defun +ivy-rich-buffer-icon (candidate)
@ -66,16 +59,14 @@ Otherwise show the fundamental-mode icon."
(current
(setq prompt "Switch to buffer: "
action #'ivy--switch-buffer-action))
(t
(setq prompt "Switch to buffer in other window: "
((setq prompt "Switch to buffer in other window: "
action #'ivy--switch-buffer-other-window-action)))
(when +ivy-buffer-preview
(cond ((not (and ivy-use-virtual-buffers
(eq +ivy-buffer-preview 'everything)))
(setq update #'+ivy--switch-buffer-preview
unwind #'+ivy--switch-buffer-unwind))
(t
(setq update #'+ivy--switch-buffer-preview-all
((setq update #'+ivy--switch-buffer-preview-all
unwind #'+ivy--switch-buffer-unwind))))
(ivy-read prompt 'internal-complete-buffer
:action action