Shougo / deoplete.nvim

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

Text typing automatically autocompletes word when set completeopt=longest option specified #1007

Closed itsNikolay closed 5 years ago

itsNikolay commented 5 years ago

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

Problems summary

Text typing automatically autocompletes word when set completeopt=longest option specified

🐛 The bug in commit https://github.com/Shougo/deoplete.nvim/commit/96759e75e3a97ee4dfe37f8b0720f95d3ee8f7cd

Expected

Text typing must not autocomplete word automatically

Environment Information

commit 6f6132cf168c2d14ab63ba497e42c49b28c43694

MacOS Mojave, version 10.14.6

:version
VIM - Vi IMproved 8.1 (2018 May 18, compiled Jun 16 2019 11:37:55)
macOS version
Included patches: 1-1551
Compiled by Homebrew
Huge version without GUI.  Features included (+) or not (-):
+acl               +cmdline_info      -farsi             +libcall           -mouse_sysmouse    +python3           -tag_any_white     +visualextra
+arabic            +comments          +file_in_path      +linebreak         +mouse_urxvt       +quickfix          -tcl               +viminfo
+autocmd           +conceal           +find_in_path      +lispindent        +mouse_xterm       +reltime           +termguicolors     +vreplace
+autochdir         +cryptv            +float             +listcmds          +multi_byte        +rightleft         +terminal          +wildignore
-autoservername    +cscope            +folding           +localmap          +multi_lang        +ruby              +terminfo          +wildmenu
-balloon_eval      +cursorbind        -footer            +lua               -mzscheme          +scrollbind        +termresponse      +windows
+balloon_eval_term +cursorshape       +fork()            +menu              +netbeans_intg     +signs             +textobjects       +writebackup
-browse            +dialog_con        +gettext           +mksession         +num64             +smartindent       +textprop          -X11
++builtin_terms    +diff              -hangul_input      +modify_fname      +packages          -sound             +timers            -xfontset
+byte_offset       +digraphs          +iconv             +mouse             +path_extra        +spell             +title             -xim
+channel           -dnd               +insert_expand     -mouseshape        +perl              +startuptime       -toolbar           -xpm
+cindent           -ebcdic            +job               +mouse_dec         +persistent_undo   +statusline        +user_commands     -xsmp
-clientserver      +emacs_tags        +jumplist          -mouse_gpm         +postscript        -sun_workshop      +vartabs           -xterm_clipboard
+clipboard         +eval              +keymap            -mouse_jsbterm     +printer           +syntax            +vertsplit         -xterm_save
+cmdline_compl     +ex_extra          +lambda            +mouse_netterm     +profile           +tag_binary        +virtualedit
+cmdline_hist      +extra_search      +langmap           +mouse_sgr         -python            -tag_old_static    +visual
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
  fall-back for $VIM: "/usr/local/share/vim"
Compilation: clang -c -I. -Iproto -DHAVE_CONFIG_H   -DMACOS_X -DMACOS_X_DARWIN  -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: clang   -L. -fstack-protector-strong -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/readline/lib  -L/u
sr/local/lib -o vim        -lncurses -liconv -lintl -framework AppKit  -L/usr/local/opt/lua/lib -llua5.3 -mmacosx-version-min=10.14 -fstack-protector-strong
 -L/usr/local/lib  -L/usr/local/Cellar/perl/5.30.0/lib/perl5/5.30.0/darwin-thread-multi-2level/CORE -lperl -lm -lutil -lc  -L/usr/local/opt/python/Framework
s/Python.framework/Versions/3.7/lib/python3.7/config-3.7m-darwin -lpython3.7m -framework CoreFoundation  -lruby.2.6

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

set nocompatible
filetype off
set encoding=utf-8

set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()

Plugin 'gmarik/Vundle.vim'

Plugin 'Shougo/deoplete.nvim'
Plugin 'roxma/nvim-yarp'
Plugin 'roxma/vim-hug-neovim-rpc'

call vundle#end()
filetype plugin indent on

" bug in `longest`
set completeopt=longest,menu,preview

let g:deoplete#enable_at_startup = 1

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

  1. Copy example main.c file from https://gist.github.com/itsNikolay/6d859287f8a579592aa37f0149dec771

  2. Run

    
    # edit `main.c` file
    vi -u vimrc main.c

start typing: include



## Generate a logfile if appropriate

 1. export NVIM_PYTHON_LOG_FILE=/tmp/log
 2. export NVIM_PYTHON_LOG_LEVEL=DEBUG
 3. nvim -u minimal.vimrc
 4. some works
 5. cat /tmp/log_{PID}

## Screenshot (if possible)

![output](https://user-images.githubusercontent.com/786577/63637759-44498980-c689-11e9-92fb-a3954ad1802d.gif)

## Upload the log file
Shougo commented 5 years ago

I don't reproduce the problem in vim8.

But in first, you must not use longest option in completeopt. It conflicts with auto completion plugins.

deoplete changes completeopt value for the problem. But it is not perfect. It may be fail like you.

Shougo commented 5 years ago

The commit should be reverted. I have found other problems.