diff --git a/modules/ui/workspaces/autoload/ivy.el b/modules/ui/workspaces/autoload/ivy.el new file mode 100644 index 000000000..97b84baf4 --- /dev/null +++ b/modules/ui/workspaces/autoload/ivy.el @@ -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 diff --git a/modules/ui/workspaces/config.el b/modules/ui/workspaces/config.el index 0fb223bf2..68c5d9221 100644 --- a/modules/ui/workspaces/config.el +++ b/modules/ui/workspaces/config.el @@ -206,6 +206,13 @@ stored in `persp-save-dir'.") ("xt" counsel-projectile-switch-project-action-run-term "invoke term from project root") ("X" counsel-projectile-switch-project-action-org-capture "org-capture into project"))) + (when (modulep! :completion ivy) + (after! ivy-rich + (cl-callf plist-put ivy-rich-display-transformers-list + '+workspace/switch-to + '(:columns ((ivy-rich-candidate (:width 50)) + (+workspace--ivy-rich-preview)))))) + (when (modulep! :completion helm) (after! helm-projectile (setcar helm-source-projectile-projects-actions