sabof / project-explorer

A project explorer sidebar
266 stars 17 forks source link

Fix pe/follow-current-open when not in project buffer #43

Open Archenoth opened 9 years ago

Archenoth commented 9 years ago

When pe/follow-current is set to t, if you visit any buffer that is not in a project and you have projectile installed, pe/follow-current-open displays an error in the minibuffer every time the timer function is run...

Error running timer `pe/follow-current-open': (error "You're not in a project") [56 times]

The error comes from Projectile when it is called with the default project root command on line 292 of project-explorer.el.

This pull request makes the timer function only try to follow the current project if we are in one.

The reason I changed pe/follow-current-open and not pe/project-root-function-default is because pe/follow-current-open appears to be the only location where this error isn't useful, and the projectile command can short-circut the logic in project-explorer so that it will be slightly more future-proof.

tonycpsu commented 8 years ago

+1, this is very useful. @sabof, do you care to merge this?