Shougo / neosnippet.vim

neo-snippet plugin
Other
1.12k stars 108 forks source link

error completing if "<{0}>" is somewhere in the code #478

Closed Bergiu closed 4 years ago

Bergiu commented 4 years ago

In my python code there is this line tmp = "<{0}>".format(...). This breaks neosnippet and i can't complete snippets anymore.

Reproduce:

  1. create a file "test.py"
  2. insert the line tmp = "<{0}>"
  3. insert " and try to complete it

Expected behaviour:

Completion of " to """ """

Actual behaviour:

Error detected while processing function <SNR>166_snippets_expand_or_jump[1]..<SNR>166_snippets_expand[6]..neosnippet#view#_expand[20]..neosnippet#view#_insert[88]..neosnippet#view#_jump[31]..neosnippet#view#_search_snippet_range[2]..<SNR>
180_substitute_placeholder_marker:                                                                                                                                                                                                             
line   29:                                                                                                                                                                                                                                     
E486: Pattern not found: \m<|0|>                                                                                                                                                                                                               
Error detected while processing function <SNR>166_snippets_expand_or_jump[1]..<SNR>166_snippets_expand:                                                                                                                                        
line    6:                                                                                                                                                                                                                                     
E171: Missing :endif                                                                                                                                                                                                                           
Error detected while processing function <SNR>166_snippets_expand_or_jump:                                                                                                                                                                     
line    1:                                                                                                                                                                                                                                     
E171: Missing :endif                                                                                                                                                                                                                           
Press ENTER or type command to continue    

Temporary solution:

Change the string "<{0}>" to "<" + "{0}>"

Shougo commented 4 years ago

I have fixed the error.

Unfortunately, neosnippet marker pattern is conflicted with your input.

I cannot remove the feature in neosnippet.