Skip to content
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

Autocommands No Request Handler #149

Open
vito-c opened this issue Dec 6, 2015 · 3 comments
Open

Autocommands No Request Handler #149

vito-c opened this issue Dec 6, 2015 · 3 comments
Labels

Comments

@vito-c
Copy link

vito-c commented Dec 6, 2015

There seems to be an error on adding autocommands to file buffers that have opening [ and closing ] in their name.

@neovim.autocmd('TextChangedI', pattern='\[abcd\]', eval='expand("<afile>")', sync=True)
def textchangedi_handler(self, filename):
    self.vim.command("echom 'hello'")

Error:
Error detected while processing TextChangedI Auto commands for "\[abcd\]": Exception('no request handler registered for "/Users/me/.config/nvim/rplugin/python/test.py:autocmd:TextChangedI:[abcd]"',) Traceback (most recent call last): File "/Library/Python/2.7/site-packages/neovim/msgpack_rpc/session.py", line 177, in handler rv = self._request_cb(name, args) File "/Library/Python/2.7/site-packages/neovim/api/common.py", line 237, in filter_request_cb walk(self._in, args, self, name, 'request')) File "/Library/Python/2.7/site-packages/neovim/plugin/host.py", line 62, in _on_request raise Exception(msg) Exception: no request handler registered for "/Users/me/.config/nvim/rplugin/python/test.py:autocmd:TextChangedI:[abcd]"

Expected Result:

au! TextChangedI \[abcd\] :echom 'hello'

version: neovim (0.0.38)

@vito-c vito-c changed the title Autocommands Autocommands No Request Handler Dec 6, 2015
@bfredl
Copy link
Member

bfredl commented Apr 2, 2016

It was likely an error that stopped the plugin from loading. This error should be echoed now (so it can be fixed)

@bfredl bfredl closed this as completed Apr 2, 2016
@vito-c
Copy link
Author

vito-c commented Apr 2, 2016

It was likely an error that stopped the plugin from loading. This error should be echoed now (so it can be fixed)

Even if it's an error that stops the plugin from loading it's still an error that shouldn't exist. You should be able to add autocommands with file name patterns that have an [ or ] in their name you have to escape them via \] ... what happens or do you have a solution for this:

au! TextChangedI \[abcd\] :echom 'hello'

@bfredl
Copy link
Member

bfredl commented Apr 2, 2016

Ah, sorry read the description too quickly, seems the \ is lost along the way (likely an issue with the neovim rplugin host logic and not python-client specifically)

@bfredl bfredl reopened this Apr 2, 2016
@justinmk justinmk added the bug label Mar 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants