Shougo / ddc.vim

Dark deno-powered completion framework for Vim/Neovim
MIT License
676 stars 32 forks source link

It shows duplicated candidates when with pum.vim. #63

Closed delphinus closed 3 years ago

delphinus commented 3 years ago

Warning: I will close the issue without the minimal init.vim and the reproduction instructions.

Problems summary

Candidates duplicate with pum.vim feature even when dup == false.

Expected

Candidates do not duplicate even with pum.vim.

Environment Information

:version ``` NVIM v0.6.0-dev+a161559 Build type: Debug LuaJIT 2.1.0-beta3 Compilation: /usr/bin/cc -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNVIM_TS_HAS_SE T_MATCH_LIMIT -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototy pes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthroug h -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=always -DINCLU DE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI _HAS_VAR_FROM -DMIN_LOG_LEVEL=1 -I/root/neovim/build/config -I/root/neovim/src -I/root/neovim/.deps/usr/include -I/usr/include -I/root/neovim/build/src/nvim/a uto -I/root/neovim/build/include Compiled by root@buildkitsandbox Features: +acl +iconv +tui See ":help feature-compile" system vimrc file: "$VIM/sysinit.vim" fall-back for $VIM: "/root/local/nvim/share/nvim" Run :checkhealth for more info ```
:checkhealth ``` denops: health#denops#check ======================================================================== - INFO: Supported Deno version: `1.14.0` - INFO: Detected Deno version: `1.14.3` - OK: Deno version check: passed - INFO: Supported Neovim version: `0.5.0` - INFO: Detected Neovim version: `0.6.0` - OK: Neovim version check: passed - INFO: Denops status: `running` - OK: Denops status check: passed nvim: health#nvim#check ======================================================================== ## Configuration - ERROR: Locale does not support UTF-8. Unicode characters may not display correctly. $LANG= $LC_ALL= $LC_CTYPE= - ADVICE: - If using tmux, try the -u option. - Ensure that your terminal/shell/tmux/etc inherits the environment, or set $LANG explicitly. - Configure your system locale. ## Performance - INFO: Build type: Debug - WARNING: Non-optimized (DEBUG) build. Nvim will be slower. - ADVICE: - Install a different Nvim package, or rebuild with `CMAKE_BUILD_TYPE=RelWithDebInfo`. - https://github.com/neovim/neovim/wiki/FAQ ## Remote Plugins - OK: Up to date ## terminal - INFO: key_backspace (kbs) terminfo entry: key_backspace=\177 - INFO: key_dc (kdch1) terminfo entry: key_dc=\E[3~ provider: health#provider#check ======================================================================== ## Clipboard (optional) - WARNING: No clipboard tool found. Clipboard registers (`"+` and `"*`) will not work. - ADVICE: - :help clipboard ## Python 2 provider (optional) - WARNING: No Python executable found that can `import neovim`. Using the first available executable for diagnostics. - ERROR: Python provider error: - ADVICE: - provider/pythonx: Could not load Python 2: python2 not found in search path or not executable. python2.7 not found in search path or not executable. python2.6 not found in search path or not executable. python not found in search path or not executable. - INFO: Executable: Not found ## Python 3 provider (optional) - WARNING: No Python executable found that can `import neovim`. Using the first available executable for diagnostics. - ERROR: Python provider error: - ADVICE: - provider/pythonx: Could not load Python 3: python3 not found in search path or not executable. python3.10 not found in search path or not executable. python3.9 not found in search path or not executable. python3.8 not found in search path or not executable. python3.7 not found in search path or not executable. python3.6 not found in search path or not executable. python not found in search path or not executable. - INFO: Executable: Not found ## Python virtualenv - OK: no $VIRTUAL_ENV ## Ruby provider (optional) - WARNING: `ruby` and `gem` must be in $PATH. - ADVICE: - Install Ruby and verify that `ruby` and `gem` commands work. ## Node.js provider (optional) - WARNING: `node` and `npm` (or `yarn`) must be in $PATH. - ADVICE: - Install Node.js and verify that `node` and `npm` (or `yarn`) commands work. ## Perl provider (optional) - ERROR: perl provider error: - ADVICE: - "Neovim::Ext" cpan module is not installed vim.lsp: require("vim.lsp.health").check() ======================================================================== - INFO: LSP log level : WARN - INFO: Log path: /root/.cache/nvim/lsp.log - INFO: Log size: 0 KB vim.treesitter: require("vim.treesitter.health").check() ======================================================================== - INFO: Runtime ABI version : 13 - OK: Loaded parser for c: ABI version 13 ```

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

call ddc#custom#patch_global({
      \ 'completionMenu': 'pum.vim',
      \ 'sources': ['around', 'look'],
      \ 'sourceOptions': {
      \   '_': {
      \     'matchers': ['matcher_head'],
      \     'converters': ['converter_truncate'],
      \   },
      \   'around': {'mark': 'A'},
      \   'look': {'mark': 'L'},
      \ },
      \ })
call ddc#enable()
inoremap <expr> <C-n> pum#visible() ? '<Cmd>call pum#map#insert_relative(+1)<CR>' : '<C-n>'
inoremap <expr> <C-p> pum#visible() ? '<Cmd>call pum#map#insert_relative(-1)<CR>' : '<C-p>'

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

  1. It shows duplicated candidates from around & look sources with init.vim above.
  2. Then I delete the line: 2 (\ 'completionMenu': 'pum.vim',) and re-run Neovim, it does not show duplicated candidates.

Screenshot (if possible)

asciicast

Shougo commented 3 years ago

Oh, dup does not work in pum.vim. I will fix it.

Shougo commented 3 years ago

Fixed. Please update dup.vim.