sassanh / qnvim

Neovim backend for Qt Creator
MIT License
136 stars 8 forks source link

Process completion in insert mode #25

Closed Shatur closed 4 years ago

Shatur commented 4 years ago

Closes #18. I disable event filtering for events in insert mode that contains text to enable auto-completion. I used startsWith because this can be applied for ic mode.

sassanh commented 4 years ago

It's not working for me. Does it work on your system?

Shatur commented 4 years ago

Yes. I even just now tested it without any plugins. The completion must to suggest items after 3 characters. For example, open any class member function and start typing "thi" in insert mode - you must see completion.

sassanh commented 4 years ago

This is how it looks here:

Screencast_04-06-2020_10_43_48 AM

Shatur commented 4 years ago

That's weird, I do not have such behavior. But thank you, I will look into it.

Shatur commented 4 years ago

I managed to reproduce the problem, I have it too, but in very rare cases. Now everything should work. Could you check it again?

Shatur commented 4 years ago

Okay, I will test QML.

Shatur commented 4 years ago

Sorry, it was my mistake. Could you test it again?

sassanh commented 4 years ago

It's now working for QML as well but it breaks some of vim functionality, it breaks imap mappings, for example I have imap ` <c-c> and it's not working in this branch. So I think we should pass keys to neovim in any circumstances and instead trigger the auto-completion from neovim because neovim has better contextual information to conclude a keypress edits the buffer or not and if it edits the buffer what are the side effects.

Shatur commented 4 years ago

You're right. I just didn’t think that someone might need to assign a letter key in insert mode. So, we need to check if buffer changed in Neovim in insert mode and if yes - send corresponding event to the Qt Creator?

Shatur commented 4 years ago

I will reopen due to rebase in master.