Skip to content

Commit

Permalink
[Fix #1212] Cache project-root in non-file-backed buffers
Browse files Browse the repository at this point in the history
`projectile-cached-buffer-file-name` would be set to nil in non-file-backed
buffers causing the root caching to not work. `'none` is used as a sentinel
value for `projectile-project-root-cache` so this reuses that for
`projectile-cached-buffer-file-name` as well.
  • Loading branch information
aaronjensen authored and bbatsov committed Jan 28, 2018
1 parent 1650a4e commit c3562c3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

### Changes

* [#1213](https://github.com/bbatsov/projectile/pull/1213): Cache project root in non-filed-backed buffers.
* [#1175](https://github.com/bbatsov/projectile/pull/1175): `projectile-register-project-type` can now set a default compilation directory for build systems that needs to build out-of-tree (eg. meson).
* [#1175](https://github.com/bbatsov/projectile/pull/1175): `projectile-{test,run}-project` now run inside `(projectile-compilation-dir)`, just like `projectile-compile-project`.
* [#1175](https://github.com/bbatsov/projectile/pull/1175): `projectile-{test,run}-project` now stores the default command per directory instead of per project, just like `projectile-compile-project`.
Expand Down
4 changes: 2 additions & 2 deletions projectile.el
Original file line number Diff line number Diff line change
Expand Up @@ -905,10 +905,10 @@ will return the current directory, otherwise it'd raise an error."
;; instead
(or (cl-subst nil 'none
(or (and projectile-cached-buffer-file-name
(equal projectile-cached-buffer-file-name buffer-file-name)
(equal projectile-cached-buffer-file-name (or buffer-file-name 'none))
projectile-cached-project-root)
(progn
(setq projectile-cached-buffer-file-name buffer-file-name)
(setq projectile-cached-buffer-file-name (or buffer-file-name 'none))
(setq projectile-cached-project-root
;; The `is-local' and `is-connected' variables are
;; used to fix the behavior where Emacs hangs
Expand Down

0 comments on commit c3562c3

Please sign in to comment.