Sarcasm / company-irony

company-mode completion back-end for irony-mode
119 stars 11 forks source link

Incorrect cursor position aftern 'return' keyword completion #39

Open kangjianbin opened 7 years ago

kangjianbin commented 7 years ago

After completion of keyword 'return', looks like cursor position is incorrect:

int f(void)
{
// before completion
    retu<complete here>
}
// after completion
return expression<cursor is here>

I need to delete 'expression' manually after completion.

Sarcasm commented 7 years ago

Indeed, with yasnippet enabled the behavior is correct, that is expression is interpreted as a placeholder. However, without yasnippet things aren't right. It looks like I'm using company-template-c-like-templatify whose guess logic does not work right in this case. irony-completion-at-point works ok in this situation. Not sure what to do, maybe company should be fixed, or irony has things that company does not, and irony should work around it.

A quick fix could be to not call company-template-c-like-templatify if there is no parentheses or square brakets, which is what company-template-c-like-templatify supports I think.

kangjianbin commented 7 years ago

Thanks. With yas-minor-mode, everything works well.