Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect cursor position aftern 'return' keyword completion #39

Open
kangjianbin opened this issue Aug 4, 2017 · 2 comments
Open

Incorrect cursor position aftern 'return' keyword completion #39

kangjianbin opened this issue Aug 4, 2017 · 2 comments

Comments

@kangjianbin
Copy link
Contributor

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
Copy link
Owner

Sarcasm commented Aug 4, 2017

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
Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants