Skip to content

Commit

Permalink
Merge pull request #957 from jbenden/cache-current-file-has-no-file-a…
Browse files Browse the repository at this point in the history
…ssoc

Do not error inside of `projectile-cache-current-file` when opening a file inside a project
  • Loading branch information
bbatsov committed Mar 18, 2016
2 parents 397d4db + 2100025 commit d166251
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 @@ -32,6 +32,7 @@
* [#955](https://github.com/bbatsov/projectile/issues/955): Error while toggling between test and source file.
* [#952](https://github.com/bbatsov/projectile/issues/952): VCS submodules brought in even thought not descendent of project root.
* [#576](https://github.com/bbatsov/projectile/issues/576): `projectile-replace` stomps regular expressions.
* [#957](https://github.com/bbatsov/projectile/pull/957): When opening a specified file from the terminal, do not error inside of `projectile-cache-current-file`.

## 0.13.0 (10/21/2015)

Expand Down
4 changes: 2 additions & 2 deletions projectile.el
Original file line number Diff line number Diff line change
Expand Up @@ -666,8 +666,8 @@ The cache is created both in memory and on the hard drive."
"Add the currently visited file to the cache."
(interactive)
(let ((current-project (projectile-project-root)))
(when (gethash (projectile-project-root) projectile-projects-cache)
(let* ((abs-current-file (file-truename (buffer-file-name (current-buffer))))
(when (and (buffer-file-name) (gethash (projectile-project-root) projectile-projects-cache))
(let* ((abs-current-file (file-truename (buffer-file-name)))
(current-file (file-relative-name abs-current-file current-project)))
(unless (or (projectile-file-cached-p current-file current-project)
(projectile-ignored-directory-p (file-name-directory abs-current-file))
Expand Down

0 comments on commit d166251

Please sign in to comment.