You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ultisnips crashes when trying to expand a snippet that starts with ^@
Expected behavior: Snippet gets expanded or nothing happens
Actual behavior: Ultisnips shows this stacktrace:
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
Please read and follow:
https://github.com/SirVer/ultisnips/blob/master/CONTRIBUTING.md#reproducing-bugs
Following is the full stack trace:
Traceback (most recent call last):
File "/home/me/.vim/pack/plugins/start/ultisnips/pythonx/UltiSnips/err_to_scratch_buffer.py", line 44, in wrapper
return func(self, *args, **kwds)
File "/home/me/.vim/pack/plugins/start/ultisnips/pythonx/UltiSnips/snippet_manager.py", line 173, in expand
if not self._try_expand():
File "/home/me/.vim/pack/plugins/start/ultisnips/pythonx/UltiSnips/snippet_manager.py", line 794, in _try_expand
before, snippets = self._can_expand(autotrigger_only)
File "/home/me/.vim/pack/plugins/start/ultisnips/pythonx/UltiSnips/snippet_manager.py", line 790, in _can_expand
return before, self._snips(before, False, autotrigger_only)
File "/home/me/.vim/pack/plugins/start/ultisnips/pythonx/UltiSnips/snippet_manager.py", line 685, in _snips
possible_snippets = source.get_snippets(
File "/home/me/.vim/pack/plugins/start/ultisnips/pythonx/UltiSnips/snippet/source/base.py", line 47, in get_snippets
snips.get_matching_snippets(
File "/home/me/.vim/pack/plugins/start/ultisnips/pythonx/UltiSnips/snippet/source/snippet_dictionary.py", line 40, in get_matching_snippets
return [s for s in all_snippets if s.matches(trigger, visual_content)]
File "/home/me/.vim/pack/plugins/start/ultisnips/pythonx/UltiSnips/snippet/source/snippet_dictionary.py", line 40, in <listcomp>
return [s for s in all_snippets if s.matches(trigger, visual_content)]
File "/home/me/.vim/pack/plugins/start/ultisnips/pythonx/UltiSnips/snippet/definition/base.py", line 314, in matches
match = vim_helper.eval('"%s" =~# "\\\\v.<."' % boundary_chars) != "0"
File "/home/me/.vim/pack/plugins/start/ultisnips/pythonx/UltiSnips/vim_helper.py", line 123, in eval
return vim.eval(text)
ValueError: embedded null byte
Steps to reproduce
I have been able to reproduce it without any custom vimrc, just the default config, and Ultisnips and honza/vim-snippets installed vía git clone:
Both vim and neovim error out if we try to evaluate a string with a null
byte in it. It appears that they use <NL> to represent <Nul> in several
places, so replace any null bytes in text for `vim_helper.eval()` with
newlines.
Fixes: SirVer#1386
yut23
added a commit
to yut23/ultisnips
that referenced
this issue
Sep 19, 2023
Both vim and neovim error out if we try to evaluate a string with a null
byte in it. It appears that they use <NL> to represent <Nul> in several
places, so replace any null bytes in text passed to `vim_helper.eval()`
with newlines.
Fixes: SirVer#1386
Ultisnips crashes when trying to expand a snippet that starts with
^@
Expected behavior: Snippet gets expanded or nothing happens
Actual behavior: Ultisnips shows this stacktrace:
Steps to reproduce
I have been able to reproduce it without any custom vimrc, just the default config, and Ultisnips and honza/vim-snippets installed vía
git clone
:^@uuid
where^@
is<C-v><C-2>
Tab
to expand the snippetThe text was updated successfully, but these errors were encountered: