From 2c4328ccf06e6bb3060facb4cd24a4f37edd461d Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 10 Aug 2021 17:29:07 -0400 Subject: [PATCH] fix: flipped logic in tramp + projectile advice Some logic derps from 0b5243c. Also restores projectile-git-submodule-command in remote buffers (to fix a wrong-type-argument error waiting to happen). Ref 0b5243c12c1e Ref #5360 --- core/core-projects.el | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/core/core-projects.el b/core/core-projects.el index abcaa31b9..094bb98f3 100644 --- a/core/core-projects.el +++ b/core/core-projects.el @@ -42,9 +42,8 @@ debian, and derivatives). On most it's 'fd'.") ;; TRAMP, so we gimp it in remote buffers. projectile-mode-line-function (lambda () - (if (file-remote-p default-directory) - (projectile-default-mode-line) - ""))) + (if (file-remote-p default-directory) "" + (projectile-default-mode-line)))) (global-set-key [remap evil-jump-to-tag] #'projectile-find-tag) (global-set-key [remap find-tag] #'projectile-find-tag) @@ -162,13 +161,16 @@ And if it's a function, evaluate it." (if (and (functionp projectile-generic-command) (not (file-remote-p default-directory))) (funcall projectile-generic-command vcs) - (funcall fn vcs))) + (let ((projectile-git-submodule-command + (get 'projectile-git-submodule-command 'initial-value))) + (funcall fn vcs)))) ;; `projectile-generic-command' doesn't typically support a function, but my ;; `doom--only-use-generic-command-a' advice allows this. I do it this way so ;; that projectile can adapt to remote systems (over TRAMP), rather then look ;; for fd/ripgrep on the remote system simply because it exists on the host. ;; It's faster too. + (put 'projectile-git-submodule-command 'initial-value projectile-git-submodule-command) (setq projectile-git-submodule-command nil projectile-indexing-method 'hybrid projectile-generic-command