New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Matchers can't remove the only completion candidate #911

Closed
Qyriad opened this Issue Jan 9, 2019 · 0 comments

Comments

Projects
None yet
1 participant
@Qyriad
Copy link

Qyriad commented Jan 9, 2019

Problems summary

If a matcher would remove a particular completion candidate, but it is the only completion candidate available, the candidate is not removed.

Expected

If a matcher would remove a particular completion candidate, even if it is the only completion candidate available, the candidate should be removed (leaving no candidates).

Environment Information

  • deoplete version (SHA1): bf6db3b, master, as of the submission of this issue

  • OS: Linux (Arch Linux, Linux 4.20.0)

  • neovim/Vim :version output:

NVIM v0.3.3
Build type: Release
LuaJIT 2.0.5
Compilation: /usr/bin/cc -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt -Wconversion -O2 -DNDEBUG -DMIN_LOG_LEVEL=3 -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fdiagnostics-color=auto -Wno-array-bounds -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -I/build/neovim/src/build/config -I/build/neovim/src/neovim-0.3.3/src -I/usr/include -I/build/neovim/src/build/src/nvim/auto -I/build/neovim/src/build/include
Compiled by builduser

Features: +acl +iconv +jemalloc +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info
  • :checkhealth or :CheckHealth result(neovim only):
Running healthchecks...
health#deoplete#check
========================================================================
## deoplete.nvim
  - OK: exists("v:t_list") was successful
  - OK: has("timers") was successful
  - OK: has("python3") was successful
  - OK: Python3.5+ was successful
  - INFO: If you're still having problems, try the following commands:
    $ export NVIM_PYTHON_LOG_FILE=/tmp/log
    $ export NVIM_PYTHON_LOG_LEVEL=DEBUG
    $ nvim
    $ cat /tmp/log_{PID}
    and then create an issue on github

health#nvim#check
========================================================================
## Configuration
  - OK: no issues found

## Performance
  - OK: Build type: Release

## Remote Plugins
  - OK: Up to date

## terminal
  - INFO: key_backspace (kbs) terminfo entry: key_backspace=^H
  - INFO: key_dc (kdch1) terminfo entry: key_dc=\E[3~
  - INFO: $VTE_VERSION='5402'
  - INFO: $COLORTERM='truecolor'

## tmux
  - OK: escape-time: 0ms
  - INFO: $TERM: tmux-256color

health#provider#check
========================================================================
## Clipboard (optional)
  - OK: Clipboard tool found: xclip

## Python 2 provider (optional)
  - WARNING: No Python interpreter was found with the pynvim module.  Using the first available for diagnostics.
  - ERROR: Python provider error
    - ADVICE:
      - provider/pythonx: Could not load Python 2:
          /usr/bin/python2 does not have the "neovim" module. :help provider-python
          /usr/bin/python2.7 does not have the "neovim" module. :help provider-python
          python2.6 not found in search path or not executable.
          /usr/bin/python is Python 3.7 and cannot provide Python 2.
  - INFO: Executable: Not found

## Python 3 provider (optional)
  - INFO: `g:python3_host_prog` is not set.  Searching for python3 in the environment.
  - INFO: Executable: /usr/bin/python3
  - INFO: Python version: 3.7.2
  - INFO: pynvim version: 0.3.1
  - OK: Latest pynvim is installed.

## 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.

Minimal init.vim

scriptencoding utf-8

syntax on
filetype plugin indent on

set completeopt=menu,menuone,preview,noselect,noinsert
let g:deoplete#enable_at_startup = 1

autocmd! VimEnter * call deoplete#custom#source('_', 'matchers', ['matcher_full_fuzzy', 'matcher_length'])

call plug#begin('~/.config/nvim/plugged')
Plug 'Shougo/deoplete.nvim'
call plug#end()

How to reproduce the problem from neovim

  1. Use a matcher such as matcher_length
  2. Type out a string for which there is only one completion candidate
  3. Observe that (for matcher_length) when the candidate is fully typed out (and thus the length of the completion string is the same as the length of the candidate), the candidate (now the same as the completion string) is still suggested as a completion.

Screenshot

screenshot from 2019-01-08 22-45-11

Logfile

nvim_python.log

@Shougo Shougo closed this in a2019e9 Jan 10, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment