From 4c028663ba78f2d4a04b670f16af437f8ceb5970 Mon Sep 17 00:00:00 2001 From: Juan Placencia Date: Mon, 14 Jun 2021 19:39:16 -0500 Subject: [PATCH] Allow project search only if in a project --- uno/modules/ui/completion.org | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/uno/modules/ui/completion.org b/uno/modules/ui/completion.org index 176653b..f3827d4 100644 --- a/uno/modules/ui/completion.org +++ b/uno/modules/ui/completion.org @@ -91,7 +91,14 @@ Integrate for searching capabilities. :after (uno-ui-completion ripgrep) :general (uno-leader-define - "/" '(consult-ripgrep :which-key "Search files"))) + "/" '(uno/ui/completion/search :which-key "Search files")) + :init + (defun uno/ui/completion/search () + "Check if in known project to avoid autoadd." + (interactive) + (if (projectile-project-p) + (consult-ripgrep) + (user-error "Not in a project")))) #+END_SRC * Company