cute-jumper / evil-embrace.el

Evil integration of embrace.el
50 stars 5 forks source link

evil-embrace opens new windows #5

Closed Somelauw closed 6 years ago

Somelauw commented 7 years ago

Steps to reproduce

Expected behaviour

It leaves (hello) and no new windows are created

Actual Behaviour

It leaves (hello), but the window has split vertically

Info

Emacs 25.2.2

cute-jumper commented 7 years ago

Hi. Thanks for reporting! To reproduce the problem, I have to wait for a second after "i". It looks like which-key and embrace interfere with each other. I'll find some time to look into it.

kassick commented 6 years ago

Setting which-key-popup-type to 'minibuffer seems to avoid the problem described by @Somelauw.

In my case, the issue also appears when using helm-mode:

In an org file: ysiwl (surround inner word , embrace with BEGIN/END) -- a helm window pops up to select the block type. After selecting one of the available block types, the window used by helm persists.

With the cursor in the original window, C-x 1 does not delete the window used by embrace-help.

I did a kludge that fixes both these problems. It does so by storing the window used by embrace--show-help-buffer and making sure it's no longer used after embrace-{region, change, delete} . It's in https://github.com/kassick/evil-embrace.el .

I think this should actually be in embrace.el (not evil-embrace) and that the solution would actually be to use more robust window-management in embrace.el -- but my emacs-foo isn't very strong.

kassick commented 6 years ago

Out-of-tree fix: https://bitbucket.org/snippets/kassick/BqyEdx File must be required before evil-embrace-enable-surround-integration .

cute-jumper commented 6 years ago

@kassick Thanks for the effort! Reminded me of this issue. I pushed a quick fix https://github.com/cute-jumper/embrace.el/commit/dd5da196e5bcc5e6d87e1937eca0c21da4334ef2. Let me know if this commit fixes the problem or not. Thanks! cc @Somelauw

kassick commented 6 years ago

@cute-jumper Yup, it fixes for me (which-key and helm issues), thanks!

cute-jumper commented 6 years ago

Awesome. I'll close this and if any problem pops out, feel free to reopen this issue.