Skip to content

Commit

Permalink
Provide a way to enter the nil perspective
Browse files Browse the repository at this point in the history
Some buffers end up in the nil perspective, this provides a way to
switch back to the nil perspective using the same mechanism that you
use to leave it.
  • Loading branch information
russell committed Feb 25, 2016
1 parent 8355671 commit cce544b
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions layers/+window-management/spacemacs-layouts/funcs.el
Original file line number Diff line number Diff line change
Expand Up @@ -103,18 +103,20 @@ perspectives does."
:sources
(helm-build-in-buffer-source "*Helm Switch Project Layout*"
:data (lambda ()
(if (projectile-project-p)
(cons (abbreviate-file-name (projectile-project-root))
(projectile-relevant-known-projects))
projectile-known-projects))
(cons persp-nil-name
(if (projectile-project-p)
(cons (abbreviate-file-name (projectile-project-root))
(projectile-relevant-known-projects))
projectile-known-projects)))
:fuzzy-match helm-projectile-fuzzy-match
:mode-line helm-read-file-name-mode-line-string
:action '(("Switch to Project Perspective" .
(lambda (project)
(let ((persp-reset-windows-on-nil-window-conf t))
(persp-switch project)
(let ((projectile-completion-system 'helm))
(projectile-switch-project-by-name project)))))))
(when (not (equal project persp-nil-name))
(let ((projectile-completion-system 'helm))
(projectile-switch-project-by-name project))))))))
:buffer "*Helm Projectile Layouts*"))

;; Autosave ----------------------------------------------------------------
Expand Down

0 comments on commit cce544b

Please sign in to comment.