From 573457f40c06a867f9613872ab41b43e61ed81f1 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Tue, 2 Jul 2024 12:11:39 +0200 Subject: emacs: avoid duplicate project.el entries --- user/emacs/init.el | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'user/emacs/init.el') diff --git a/user/emacs/init.el b/user/emacs/init.el index c2a53334..45054237 100644 --- a/user/emacs/init.el +++ b/user/emacs/init.el @@ -997,13 +997,21 @@ _C-k_: prev _u_pper _=_: upper/lower _s_mart resolve :config (progn (treemacs-load-theme "simple"))) +(defun ap/consult-ghq-switch-project (dir) + "Append a slash to avoid project.el remembering two different +paths for the same project." + (interactive) + (project-switch-project (if (string-suffix-p "/" dir) + dir + (concat dir "/")))) (use-package consult-ghq :defer 5 :general (:keymaps 'project-prefix-map "o" #'consult-ghq-switch-project) :config (progn (setq consult-ghq-grep-function #'consult-grep - consult-ghq-find-function #'consult-find))) + consult-ghq-find-function #'consult-find + consult-ghq-switch-project-function #'ap/consult-ghq-switch-project))) (use-package envrc :defer 2 -- cgit 1.4.1