feat(workspaces): +workspace/switch-to: add buffer list column

To offer more context for ivy users while switching between workspaces.

Close: #3006
Co-authored-by: rgrinberg <rgrinberg@users.noreply.github.com>~
This commit is contained in:
Henrik Lissner 2022-11-02 18:44:03 +01:00
parent 33db882ae6
commit 086e9a9322
No known key found for this signature in database
GPG key ID: B60957CA074D39A3
2 changed files with 24 additions and 0 deletions

View file

@ -0,0 +1,17 @@
;;; ui/workspaces/autoload/ivy.el -*- lexical-binding: t; -*-
;;;###if (modulep! :completion ivy)
;;;###autoload
(defun +workspace--ivy-rich-preview (workspace)
(if-let (buffers (when-let (workspace (gethash workspace *persp-hash*))
(cl-loop for (type . rest) in (persp-window-conf workspace)
if (eq type 'buffer)
collect (car leaf)
else if (eq type 'leaf)
append (cl-loop for (type . leaf) in rest
if (eq type 'buffer)
collect (car leaf)))))
(string-join buffers " ")
"*No buffers*"))
;;; ivy.el ends here