completion-nvim icon indicating copy to clipboard operation
completion-nvim copied to clipboard

Strange completion sorting with right behavior after backspace

Open ghost opened this issue 4 years ago • 0 comments

Relevant information

Nvim v.0.5.0 LuaJIT 2.1.0-beta3 Clangd 12.0.1

init.vim

lua require'lspconfig'.clangd.setup{on_attach=require'completion'.on_attach} inoremap <Tab> pumvisible() ? "<C-n>" : "<Tab>" inoremap <S-Tab> pumvisible() ? "<C-p>" : "<S-Tab>"

set number set relativenumber set completeopt=menuone,noinsert,noselect set shortmess+=c let g:completion_matching_strategy_list = [ 'exact' , 'substring' , 'fuzzy' ] let g:completion_matching_ignore_case = 1 let g:completion_trigger_character = ['.', '->'] let g:completion_sorting = "length"

Issue and expectation

When I start to type vkimage I will get this when I get to letter i:

•VkImageFormatListCreateInfoKHR •VkFilter
•VkDeviceSize
•vkQueueWaitIdle(VkQueue queue)
•VkPipelineLayout
•VkSubmitInfo2KHR
•VkLayerProperties
...

Also, VkImage will not show up, even if I type the the whole word vkimage.

But, if I press backspace to remove letter i and type it again, I will get this:

•VkImage
•VkInstance
•VkImageType
•VkImageView
•VkIndexType
•VkIndexType
•VkImageCopy
•VkImageCopy
•VkImageType
...

Which is what I am expecting. I can reproduce this issue with other words too. Not sure how to start testing the root cause.

ghost avatar Sep 18 '21 08:09 ghost