fix(ivy): counsel-projectile-switch-project: empty list on first run

This is due to `counsel-projectile-switch-project` not initializing the
known projects list before consulting the `projectile-known-projects`
variable (or at the very least, calling the function of the same name,
rather than referencing the variable directly). By changing
counsel-projectile-remove-current-project, it now does.
This commit is contained in:
Henrik Lissner
2025-04-02 04:13:50 -04:00
parent cf41865693
commit 760a92e952

View File

@ -326,6 +326,14 @@ workable results ripgrep produces, despite the error."
(setf (alist-get 'projectile-find-file counsel-projectile-key-bindings)
#'+ivy/projectile-find-file)
;; HACK: Force `counsel-projectile-switch-project' to call
;; `projectile-relevant-known-projects' and initialize the known projects
;; list, because otherwise it's trying to read from the
;; `projectile-known-projects' variable directly instead of calling the
;; function of the same name.
;; REVIEW: This should be fixed upstream.
(setq counsel-projectile-remove-current-project t)
;; no highlighting visited files; slows down the filtering
(ivy-set-display-transformer #'counsel-projectile-find-file nil)