diff options
| author | Constantine Vetoshev <gepardcv@gmail.com> | 2020-11-08 21:53:28 -0800 |
|---|---|---|
| committer | Constantine Vetoshev <gepardcv@gmail.com> | 2020-11-08 22:00:24 -0800 |
| commit | e4cbee6a132d57b4a1fcb89643c0f40116be5726 (patch) | |
| tree | 2de4b39adb204aa6519ca88d38f3ad05756ef935 | |
| parent | b2baf2a98b7ad778e2d67a2ce31029458ab3940f (diff) | |
Make C-k respect perspectives in persp-ivy-switch-buffer.
| -rw-r--r-- | perspective.el | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/perspective.el b/perspective.el index e05213b..2bc94a6 100644 --- a/perspective.el +++ b/perspective.el @@ -1271,7 +1271,16 @@ PERSP-SET-IDO-BUFFERS)." "A version of `ivy-switch-buffer' which respects perspectives." (interactive "P") (declare-function ivy-switch-buffer "ivy.el") - (persp--switch-buffer-ivy-counsel-helper arg nil #'ivy-switch-buffer)) + (declare-function ivy--buffer-list "ivy.el") + (let ((saved-ivy-buffer-list (symbol-function 'ivy--buffer-list)) + (temp-ivy-buffer-list (lambda (_str &optional _virtual _predicate) + (persp-current-buffer-names)))) + (unwind-protect + (progn + (when (and persp-mode (null arg)) + (setf (symbol-function 'ivy--buffer-list) temp-ivy-buffer-list)) + (persp--switch-buffer-ivy-counsel-helper arg nil #'ivy-switch-buffer)) + (setf (symbol-function 'ivy--buffer-list) saved-ivy-buffer-list)))) ;; Buffer switching integration: Counsel. ;;;###autoload |
