fix(workspaces): remove ivy integration

Due to upstream changes in ivy-rich, +workspace/switch-to throws a
`wrong-type-argument listp leaf` error. As I plan to phase out Ivy
support (and the Ivy module) in the long term, I'll simply remove
ivy (and ivy-rich) integration in the workspaces module, rather than
update it.

Fix: #7499
Fix: #7173
This commit is contained in:
Henrik Lissner 2024-03-26 10:11:34 -04:00
parent 286be1b249
commit 90070c639a
No known key found for this signature in database
GPG key ID: B60957CA074D39A3
3 changed files with 1 additions and 30 deletions

View file

@ -1,17 +0,0 @@
;;; 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

View file

@ -318,12 +318,7 @@ workspace, otherwise the new workspace is blank."
end of the workspace list." end of the workspace list."
(interactive (interactive
(list (or current-prefix-arg (list (or current-prefix-arg
(if (modulep! :completion ivy) (completing-read "Switch to workspace: " (+workspace-list-names)))))
(ivy-read "Switch to workspace: "
(+workspace-list-names)
:caller #'+workspace/switch-to
:preselect (+workspace-current-name))
(completing-read "Switch to workspace: " (+workspace-list-names))))))
(when (and (stringp index) (when (and (stringp index)
(string-match-p "^[0-9]+$" index)) (string-match-p "^[0-9]+$" index))
(setq index (string-to-number index))) (setq index (string-to-number index)))

View file

@ -206,13 +206,6 @@ stored in `persp-save-dir'.")
("xt" counsel-projectile-switch-project-action-run-term "invoke term from project root") ("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"))) ("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) (when (modulep! :completion helm)
(after! helm-projectile (after! helm-projectile
(setcar helm-source-projectile-projects-actions (setcar helm-source-projectile-projects-actions