Skip to content

Commit

Permalink
[Fix bbatsov#1016] Switching projects does not include the current pr…
Browse files Browse the repository at this point in the history
…oject
  • Loading branch information
s-surineni committed Oct 2, 2018
1 parent b99f023 commit 22afbb5
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions projectile.el
Original file line number Diff line number Diff line change
Expand Up @@ -3472,13 +3472,21 @@ An open project is a project with any open buffers."
(list (abbreviate-file-name (projectile-project-root))))
projects))

(defun projectile--move-current-project-to-end (projects)
"Move current project (if any) to the end of list in the list of PROJECTS"
(if (projectile-project-p)
(append
(projectile--remove-current-project projects)
(list (abbreviate-file-name (projectile-project-root))))
projects))

(defun projectile-relevant-known-projects ()
"Return a list of known projects except the current one (if present)."
(projectile--remove-current-project projectile-known-projects))
(projectile--move-current-project-to-end projectile-known-projects))

(defun projectile-relevant-open-projects ()
"Return a list of open projects except the current one (if present)."
(projectile--remove-current-project (projectile-open-projects)))
(projectile--move-current-project-to-end (projectile-open-projects)))

;;;###autoload
(defun projectile-switch-project (&optional arg)
Expand Down

0 comments on commit 22afbb5

Please sign in to comment.