SirVer / ultisnips

UltiSnips - The ultimate snippet solution for Vim. Send pull requests to SirVer/ultisnips!
GNU General Public License v3.0
7.55k stars 691 forks source link

Crash when used in combination with CtrlP #229

Closed netmute closed 10 years ago

netmute commented 10 years ago

When I expand a snippet using the g:UltiSnipsExpandTrigger keys, then leave insert mode and trigger CtrlP, I get this error:

An error occured. This is either a bug in UltiSnips or a bug in a
snippet definition. If you think this is a bug, please report it to
https://github.com/SirVer/ultisnips/issues/new.

Following is the full stack trace:
Traceback (most recent call last):
File "/Users/se/.vim/bundle/ultisnips/pythonx/UltiSnips/snippet_manager.py", line 48, in wrapper return func(self, *args, **kwds)
File "/Users/se/.vim/bundle/ultisnips/pythonx/UltiSnips/snippet_manager.py", line 284, in _cursor_moved self._check_if_still_inside_snippet()
File "/Users/se/.vim/bundle/ultisnips/pythonx/UltiSnips/snippet_manager.py", line 315, in _check_if_still_inside_snippet self._current_snippet_is_done()
File "/Users/se/.vim/bundle/ultisnips/pythonx/UltiSnips/snippet_manager.py", line 323, in _current_snippet_is_done _vim.command("callUltiSnips#map_keys#RestoreInnerKeys()")
File "/Users/se/.vim/bundle/ultisnips/pythonx/UltiSnips/_vim.py", line 88, in command return as_unicode(vim.command(as_vimencoding(cmd)))
error: Vim(iunmap):E31: No such mapping
SirVer commented 10 years ago

I cannot reproduce. I tried this (with vim-snippets being tracked)

vim /tmp/filetype.py
iclass<expand trigger><esc>:CtrlPBuffer

can you provide a repro case?

SirVer commented 10 years ago

ping?

netmute commented 10 years ago

Sorry. I'm still trying to get this reproducible. I'm able to trigger the bug with the steps described above, but not every time. When I try that in a blank file, everything works. When working with an existing Javascript file it crashes.

SirVer commented 10 years ago

just let me know when you find a reliable way to reproduce. :thumbsup:

netmute commented 10 years ago

I think I have an example now. Open an existing file, for example this html: https://gist.github.com/netmute/04f5130c9d098a05bad8 Then expand the "input" snippet, go to normal mode and trigger CtrlP. It crashes every time for me.

SirVer commented 10 years ago

yep, that's it. I can reproduce now. I put it on my list to look into that, but I am a bit swamped right now, so no promises when I get around to it. Thanks for figuring this out.

SirVer commented 10 years ago

Should be fixed through an awful hack.

netmute commented 10 years ago

Great, thanks! :)