Skip to content

Commit

Permalink
Leave archive before searching for project root
Browse files Browse the repository at this point in the history
When TRAMP archives are enabled, back out of the archive before trying to find
the project root. Starting inside the archive makes opening archives quite slow.
  • Loading branch information
Stebalien authored and bbatsov committed Mar 7, 2020
1 parent 341150c commit cc202fb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## master (unreleased)

* [#1497](https://github.com/bbatsov/projectile/pull/1497)] New command `projectile-run-gdb` (<kbd>x g</kbd> in `projectile-command-map`).
* [#1503](https://github.com/bbatsov/projectile/pull/1503)] Leave archive before searching for the project root.

## 2.1.0 (2020-02-04)

Expand Down
5 changes: 5 additions & 0 deletions projectile.el
Original file line number Diff line number Diff line change
Expand Up @@ -1077,6 +1077,11 @@ If DIR is not supplied its set to the current directory by default."
;; cl-subst to replace this 'none value with nil so a nil value is used
;; instead
(let ((dir (or dir default-directory)))
;; Back out of any archives, the project will live on the outside and
;; searching them is slow.
(when (and (fboundp 'tramp-archive-file-name-archive)
(tramp-archive-file-name-p dir))
(setq dir (file-name-directory (tramp-archive-file-name-archive dir))))
(cl-subst nil 'none
;; The `is-local' and `is-connected' variables are
;; used to fix the behavior where Emacs hangs
Expand Down

0 comments on commit cc202fb

Please sign in to comment.