Shougo / deoplete.nvim

:stars: Dark powered asynchronous completion framework for neovim/Vim8
Other
5.94k stars 295 forks source link

deoplete#complete_common_string doesn't work with fuzzy matcher #1181

Closed bew closed 3 years ago

bew commented 3 years ago

Problems summary

Trying to use deoplete#complete_common_string() only works when the input text is not using the fuzzy matcher.

With input: gigu#huk# and completions like:

Calling the function deoplete#complete_common_string() doesn't work. It only works if the input is githutter#h (to get githutter#hunk# in this example).

Expected

Calling this function should replace the input and enter gitgutter#hunk# automatically.

Environment Information

neovim/Vim `:version` output: ``` NVIM v0.4.3 Build type: Release LuaJIT 2.1.0-beta3 Compilation: Compiled by nixbld Features: +acl +iconv +tui See ":help feature-compile" system vimrc file: "$VIM/sysinit.vim" fall-back for $VIM: " /nix/store/qrz30rk009irha1lzwgcbagd6hjfjr46-neovim-unwrapped-0.4.3/share/nvim " Run :checkhealth for more info ```
`checkhealth` or `:CheckHealth` result(neovim only) ``` - OK: exists("v:t_list") was successful - OK: has("timers") was successful - OK: has("python3") was successful - OK: Require Python 3.6.1+ was successful - OK: Require msgpack 1.0.0+ was successful ```

Provide a minimal init.vim/vimrc with less than 50 lines (Required!)

set runtimepath+=.
let g:deoplete#enable_at_startup = 1

inoremap <silent><expr> <C-b> deoplete#complete_common_string()

How to reproduce the problem from neovim/Vim startup (Required!)

Enter these lines in a files:

loreminator
loremonatir

Then on a new line, start typing lom completion should show the 2 choices, try pressing <C-b>. :point_right: nothing happens (I should get lorem.

The mapping is good though because when typing lor then pressing <C-b> I get lorem

Screenshot (if possible)

Real-life example: deoplete_common_substring_fuzzy

Shougo commented 3 years ago

Fixed.

bew commented 3 years ago

Thanks, works perfectly :+1: