Fix #1311: remove project check in ivy transformer
Also: minor refactor of `cond` fallback blocks
This commit is contained in:
parent
1fab389d9e
commit
e60b44d255
1 changed files with 7 additions and 16 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue