emacs-evil / evil-surround

you will be surrounded (surround.vim for evil, the extensible vi layer)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Surround friendly text objects must be declared on global map

iyefrat opened this issue · comments

evil-surround-(inner|outer)-overlay matches the inputted character against the global text object map. This means that in order to have minor-mode specific text objects that interact with evil-surround, they must be defined on the global keymap, where they might conflict with other mappings.

Would it be possible to add support for reading text objects from a local keymap? This seems very doable, and I'd be happy to make a PR.

@itai33, since we have a decent test set now, feel free to do it.

Ideally, the PR should add some tests to verify this funcionality.

excellent! just to be sure, when you say tests, you mean things using ert in evil-surround-test.el right?

@ninrod in this line, you include as part of your test csw), however this leads to the error No such a pair found (which also causes the test to fail). In neovim using vim-surround, this does surround the word with parentheses as expected. Is the test wrong or is this a bug?

Edit:
My apologies, the problem is somewhere in my config, this works as expected in vanilla emacs.

Edit2: well it seems that evil-surround-test.el fails also on vanilla emacs, does it work on your end?

Yes. You should try using make test, as described in the readme, or make emacs. It uses a naked emacs with only the absolute minimum dependencies you need.

That works, thank you. I'll submit a PR as soon as I finish writing the added tests.

PR #165 by @itai33 successfully implements the behaviour.