Closed markwu closed 8 years ago
Yeah, this would be useful.
I use UltiSnips with similar settings as yours, and I don't see conflicts. Could you please provide a step-by-step way to reproduce your problem?
Okay, I'll prepare a minimal vimrc and screencasts for you.
Hi @lifepillar I just update the comment with minimal vimrc and screencast, hope this help.
Ah, now I see. Could you please play a bit with the ultisnips-bug
branch to see if things work better for you?
Thanks, It works like a charm.
Thanks for the feedback. The fix is not final (you may have issues with automatic completion stopping to work after completing a snippet), but at least I have an idea of how to solve this issue.
Ok, I have investigated that. It happens only with certain snippets. The specific example you have shown can be solved by editing php.snippets
and putting the w
flag next to the foreach
snippet:
snippet foreach "foreach ($var as $value) { .. }" w
foreach ($${1:variable} as $${2:value}) {
${0}
}
So, I don't think that this is something that should be fixed in µcomplete.
Can I use ultisnips in master
branch yet, or is this functionality still in the other one?
Use master.
The problem is current UltiSnips and vim-snippets works great with YouCompletMe and NeoComplete, it must be something conflict between mucomplete and these plugins.
If you can give me some ideas why this happened, I'll do some investigations on this problem.
Thanks.
So far, I have only noted that snippets with flags like w
do not have conflicts.
I turned off mucomplete auto completion, everything just works.
So, it might be UltiSnips forward jump trigger hijacked by something inside TextChangeI event.
Or, it also could be UltiSnips thinks no need to jump.
I compose a new screencast
foreach
, I keep hit <C-J>
, it can expand and jump without any problems.foreach
, I typed $items
and hit <C-J>
, nothing happened.How interesting.
Removing the 'omni'
method from the completion list fixes the bug. So, the problem is a bad interaction between PHP's omnifunc
function and UltiSnips. In fact, turn off µcomplete and type:
foreach<c-j>items<c-x><c-o>
and then <c-j>
is screwed up. So, I stand by my assertion that this is not a problem for µcomplete to solve.
Okay, I just did the same test as you did, you convince me, you are right.
It seems phpcomplete break ultisnips, I tried javascript omni complete, it works great.
I'll report this issue to https://github.com/shawncplus/phpcomplete.vim .
Thanks.
Thanks for your hint.
I guess the problem never happened in YouCompleteMe & NeoComplete, because they just use phpcomplete.vim as a source to get candidate list and use their own customized complete function to complete the word.
@lifepillar
I think @complex857 (The maintainer of phpcomplete.vim) already fixed this bug in this commit https://github.com/shawncplus/phpcomplete.vim/commit/1d0041837432033593d407e4494939f3c4e411f8.
And, I already tested it with mucomplete and Ultisnips, these three plugins works great together.
Just for your information and thanks for your help.
Problems summary
UltiSnips's ForwardTrigger and BackwardTrigger not working
Environment Information
Provide a minimal .vimrc with less than 50 lines (Required!)
The reproduce ways from Vim starting (Required!)
:e test.php
orset ft=php
foreach
the popup menu will show up, choose it and hit<C-J>
to expand it, then you can't not use<C-J>
to jump next positionScreen shot (if possible)