Bram Moolenaar wrote:

Hi, Bram
  Thanks for your reply!

Vincent Linsong wrote:

This is by design.  Some people mentioned that when using the longest
common string the first entry should not be selected.  Now you can use
CTRL-N to select the first entry.  Previously you would need to do
CTRL-N CTRL-P to get the first entry.
  I use the omnicompletion like this:
I set completeopt=menu,preview,longest . Now consider I input some characters of a function's name, for example, the function's name is 'helloWorld' and I input 'hel'. I am not glad to remember the exact function name, so I invoke omnicompletion by <C-X><C-O>, then I know what is the exact name of the function, instead of press <C-N> or <C-P> multiple times to select it from the menu, I choose to input more characters and when function's name becomes the top entry on the menu, I will press <C-Y> to accept it. I think this way is very convenient and I know many intelligence like tools works in this way. If others have enough reason to change the behavior, would you like to add a new option to make two ways work ? Thanks a lot!

I think the current behavior is best for most people.  For you, instead
of pressing CTRL-Y you can use CTRL-N and continue typing, that normally
stops completion.
If I press CTRL-N, then what I inputed will be replaced with the first entry of the completion menu, but that is not what I want.

I don't know other tools that use CTRL-Y...
I think my sentence is a little confusing. I don't mean CTRL-Y is very common but the way to use completion.

You might be tempted to hit
<Enter> to accept the current match, we had that discussion before.
That kind of use simply doesn't go well with "longest".

My main point is: I don't want to select entry in the completion menu by pressing CTRL-N or CTRL-P, instead, I want to input enough characters to make correct entry become the first entry and it is highlighted, then I can use CTRL-Y(yes, I have mapped <Enter> to CTRL-Y since I am tempted to use <Enter>) to confirm the completion.

Thanks again.

Best regards,
Vincent




Reply via email to