nex3 / perspective-el

Perspectives for Emacs.
MIT License
894 stars 71 forks source link

C-k in persp-ivy-switch-buffer doesn't maintain perspective local buffer list #134

Closed Ultramann closed 4 years ago

Ultramann commented 4 years ago

First, I love perspective, so thanks for all the work on this package; now on to the issue.

If you invoke C-k in the persp-ivy-switch-buffer minibuffer the selected buffer is correctly killed, but the minibuffer buffer list is updated to include all buffers, not just perspective local ones. I did a little homework and the cause seems apparent. 1.persp-ivy-switch-buffer calls to persp--switch-buffer-ivy-counsel-helper https://github.com/nex3/perspective-el/blob/17cfb7f3a50c5ebc8edafd6418531c17c2cbf47e/perspective.el#L1270-L1274

  1. persp--switch-buffer-ivy-counsel-helper has the meat of the logic, does the filters of buffers to display in the minibuffer by current perspective, it also sets the keymap in the minibuffer to the ivy-switch-buffer-map, which maps C-k to ivy-switch-buffer-kill [0] which isn't perspective aware. https://github.com/nex3/perspective-el/blob/17cfb7f3a50c5ebc8edafd6418531c17c2cbf47e/perspective.el#L1248-L1262

It feels like C-k should maintain the perspective local buffer list; but my elisp foo isn't great I'm not sure what the best way to fix this myself.

[0] https://github.com/abo-abo/swiper/blob/e58bfc162a2df5b67a820d0311c313d3db522073/ivy.el#L4419

gcv commented 4 years ago

Good catch! I just pushed a workaround for this problem: e4cbee6a13. It should now be in MELPA. Could you please try it and let me know how it works for you?

Ultramann commented 4 years ago

Seems to work perfectly! Many thanks!