Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not error inside of projectile-cache-current-file when opening a file inside a project. #957

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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