company-irony icon indicating copy to clipboard operation
company-irony copied to clipboard

Incorrect cursor position aftern 'return' keyword completion

Open kangjianbin opened this issue 7 years ago • 2 comments

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.

kangjianbin avatar Aug 04 '17 16:08 kangjianbin

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.

Sarcasm avatar Aug 04 '17 17:08 Sarcasm

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

kangjianbin avatar Aug 04 '17 18:08 kangjianbin