aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcos Almeida <maurelio1234@users.noreply.github.com>2020-12-20 19:13:05 +0100
committerGitHub <noreply@github.com>2020-12-20 20:13:05 +0200
commit5dd9f0674dad30e4aa44245fed99c8273ad7f76c (patch)
tree75de4f365c2dd892e072cfa820fb99b2d8d1afa5
parent3b213900c8f12d3711a7790c6620d4b9dfc38ea0 (diff)
[Fix #1624] Avoid touching users' windows in projectile-files-via-ext-command (#1626)
Also fixes #1625.
-rw-r--r--projectile.el17
1 files changed, 9 insertions, 8 deletions
diff --git a/projectile.el b/projectile.el
index bba0923..3a0eaff 100644
--- a/projectile.el
+++ b/projectile.el
@@ -1372,14 +1372,15 @@ If `command' is nil or an empty string, return nil.
This allows commands to be disabled.
Only text sent to standard output is taken into account."
- (when (stringp command)
- (let ((default-directory root))
- (with-temp-buffer
- (let ((stderr-buffer (current-buffer)))
- (with-temp-buffer
- (shell-command command t stderr-buffer)
- (let ((shell-output (buffer-substring (point-min) (point-max))))
- (split-string (string-trim shell-output) "\0" t))))))))
+ (save-window-excursion
+ (when (stringp command)
+ (let ((default-directory root))
+ (with-temp-buffer
+ (let ((stderr-buffer (current-buffer)))
+ (with-temp-buffer
+ (shell-command command t stderr-buffer)
+ (let ((shell-output (buffer-substring (point-min) (point-max))))
+ (split-string (string-trim shell-output) "\0" t)))))))))
(defun projectile-adjust-files (project vcs files)
"First remove ignored files from FILES, then add back unignored files."