-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Provide a way to enter the nil perspective #5233
Conversation
This patch could possibly activate helm-mini on re-entry into the nil perspective? at the moment it just switches back to the perspective. |
FYI |
: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)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could use (unless ...
instead of (when (not ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, too much python for me i think...
Doesn't |
It does, somehow I missed it when looking at |
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.
cce544b
to
7724acb
Compare
Ah yeah, i didn't find |
Ok, after some time to think about it, I believe that this patch could be better.
I have an alternative implementation below that instead of adding the nil perspective to the list, it adds in the (defun spacemacs/helm-persp-switch-project (arg)
(interactive "P")
(helm
:sources
`(,(helm-build-in-buffer-source "Switch Project"
:data (lambda ()
(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)))))))
,(spacemacs//helm-perspectives-source))
:buffer "*Helm Projectile Layouts*"))
`` |
This PR has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this PR is still need merging! |
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.