Deoplete.nvim: deoplete trigger competition automatically

Created on 28 Feb 2017  Â·  31Comments  Â·  Source: Shougo/deoplete.nvim

Problems summary

after recent update I began to notice that sometimes, if I quickly enough print word - it will be completed automatically, without permission

The reproduce ways from neovim starting

init.vim, which I use in reproduction

" setup & dein {{{
  set rtp+=~/.config/nvim/bundle/repos/github.com/Shougo/dein.vim
  call dein#begin(expand('~/.config/nvim/bundle/'))
  call dein#add('Shougo/dein.vim')
"}}}

call dein#add('Shougo/deoplete.nvim') " {{{
  let g:deoplete#enable_at_startup = 1
" }}}

In command line
rm -rf nvim/bundle nvim/.cache && git clone https://github.com/Shougo/dein.vim nvim/bundle/repos/github.com/Shougo/dein.vim

and video

As you see, if I type new quickly enough (skill is required :smile:), it paste first match automatically, I don`t remember such behavior in past

Environment Information

  • deoplete version(SHA1): 7a9865ae3db5ebed3c5b96f48ed3d769a99c72cf (_oh, I see in commit that you had changed auto_complete_delay_)
  • OS: archlinux
  • neovim version:
 pacman -Qi neovim-git 
Name            : neovim-git
Version         : 0.1.7.r707.gd290c1342-1

NVIM v0.2.0-707-gd290c1342
Build type: RelWithDebInfo
Compilation: /usr/bin/cc -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -Wconversion -O2 -g -DDISABLE_LOG -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wvla -fstack-protector-strong -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -DHAVE_CONFIG_H -D_GNU_SOURCE -I/tmp/yaourt-tmp-bjorn/aur-neovim-git/src/neovim-git/build/config -I/tmp/yaourt-tmp-bjorn/aur-neovim-git/src/neovim-git/src -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/tmp/yaourt-tmp-bjorn/aur-neovim-git/src/neovim-git/build/src/nvim/auto -I/tmp/yaourt-tmp-bjorn/aur-neovim-git/src/neovim-git/build/include
Compiled by bjorn@machine

Optional features included (+) or not (-): +acl   +iconv    +jemalloc +tui      
For differences from Vim, see :help vim-differences

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

  • :CheckHealth result(neovim ver.0.1.5-452+):
## Configuration
  - SUCCESS: no issues found

## Performance
  - SUCCESS: Build type: RelWithDebInfo

## Remote Plugins
  - SUCCESS: Up to date

## terminal
  - INFO: key_backspace (kbs) terminfo entry: key_backspace=\177
  - INFO: key_dc (kdch1) terminfo entry: key_dc=\E[3~

health#provider#check
========================================================================
## Clipboard
  - SUCCESS: Clipboard tool found: xclip

## Python 2 provider
  - INFO: `g:python_host_prog` is not set.  Searching for python2 in the environment.
  - INFO: Executable: /usr/bin/python2
  - INFO: Python2 version: 2.7.13
  - INFO: python2-neovim version: 0.1.13
  - SUCCESS: Latest python2-neovim is installed: 0.1.13

## Python 3 provider
  - INFO: `g:python3_host_prog` is not set.  Searching for python3 in the environment.
  - INFO: Executable: /usr/bin/python3
  - INFO: Python3 version: 3.6.0
  - INFO: python3-neovim version: 0.1.13
  - SUCCESS: Latest python3-neovim is installed: 0.1.13

## Ruby provider
  - INFO: Ruby: ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-linux]
  - INFO: Host: /home/bjorn/.rvm/gems/ruby-2.4.0@rails-bookstore/bin/neovim-ruby-host
  - ERROR: Command timed out: gem list -ra ^neovim$
  - ERROR: Failed to run: gem list -ra ^neovim$
    - SUGGESTIONS:
      - Make sure you're connected to the internet.
      - Are you behind a firewall or proxy?

Most helpful comment

This is bug of Vim/neovim.
I will create the patch to fix it.

It depends on your machine speed and your configuration and your input time.
If the problem persists, please change g:deoplete#auto_complete_delay time.

All 31 comments

I get the same behavior on Windows. Was actually preparing to report.

@rmolin88 , I think it auto_complete_delay, after I had changed it to old value, weird behavior gone

let g:deoplete#auto_complete_delay=50

@BjornMelgaard Thanks! Seems to have gone away with your fix

@rmolin88 , it`s not, just now I had same experience
Will see what happen tomorrow

Well, because deoplete is asynchronous...
It is hard to fix.

I have added pumvisible() check.
Please check the latest version.

@BjornMelgaard Please add the real reproduce ways in the video.
You have not uploaded the script and the reproduce ways in editing the file.
I cannot reproduce it.

Here is my reproduction video:
https://asciinema.org/a/8ellal7t7rosye9auw0yhez7d
I switch between auto_complete_delay = 0 and 50

Using commit 9574fcdcb74011b866b58ae7ca750c71272c0614

:version
NVIM v0.2.0-44-g80892924

:CheckHealth

health#deoplete#check
========================================================================
## deoplete.nvim
  - SUCCESS: has("nvim") was successful
  - SUCCESS: has("python3") 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
  - SUCCESS: no issues found

## Performance
  - SUCCESS: Build type: RelWithDebInfo

## Remote Plugins
  - SUCCESS: Up to date

## terminfo
  - INFO: key_backspace terminfo entry: key_backspace=\177,

health#provider#check
========================================================================
## Clipboard
  - SUCCESS: Clipboard tool found: pbcopy

## Python 2 provider
  - INFO: `g:python_host_prog` is not set.  Searching for python2 in the environment.
  - INFO: Executable: /usr/local/bin/python2
  - INFO: Python2 version: 2.7.13
  - INFO: python2-neovim version: 0.1.12
  - WARNING: Latest python2-neovim is NOT installed: 0.1.13

## Python 3 provider
  - INFO: `g:python3_host_prog` is not set.  Searching for python3 in the environment.
  - INFO: Executable: /usr/local/bin/python3
  - INFO: Python3 version: 3.6.0
  - INFO: python3-neovim version: 0.1.13
  - SUCCESS: Latest python3-neovim is installed: 0.1.13

## Ruby provider
  - ERROR: Missing Neovim RubyGem
    - SUGGESTIONS:
      - Install or upgrade the neovim RubyGem using `gem install neovim`.
  - INFO: Ruby Version: ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-darwin16]
  - INFO: Host Executable: not found
  - INFO: Host Version: not found

@Shougo, I have updated to new version and set g:auto_complete_delay = 50, but this does not fix bug.

Reproduction:
video
used config/nvim with log

I am having this exact problem and it does seem to stop happening when i

let g:deoplete#auto_complete_delay = 147

the bug is still there if #auto_complete_delay is around 50, but above 100 seems to be fine

perhaps some race condition?

I have to say that I haven't seen it anymore with delay of 50.

On Mar 1, 2017 11:19 AM, "chee" notifications@github.com wrote:

I am having this exact problem and it does seem to stop happening when i

let g:deoplete#auto_complete_delay = 147

the bug is still there if #auto_complete_delay is around 50, but above 100
seems to be fine

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/Shougo/deoplete.nvim/issues/440#issuecomment-283388058,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AFLU_4D2gm4Tad6TPvz-EN0XzOVDO2Coks5rhZqjgaJpZM4MOzoR
.

@chee, :smile: I have thought the same with auto_complete_delay = 50, and I just wondering, how you get this number?)

Within the last few days the default has gone from 150 -> 50 -> 0, so try 150 if you're still having issues.

@billyvg , ha, great descending. I already using 150/147 and I have been programming for an hour and didnt notice this bug, thanks @chee :+1:

thanks, shougo :tada:!!

I'm sorry guys, but I have reinstalled all plugins without remainder, made "UpdateRemotePlugins" and bug still present
But when I try to reproduce it on video, I can't get right combination as I did. Should I try harder? Am I one who experience that?
I'll better stick to let g:deoplete#auto_complete_delay = 150, at least it works

" have experienced bug with this in my main init.vim
call dein#add('Shougo/deoplete.nvim') " {{{
  call dein#add('fishbullet/deoplete-ruby')
  let g:deoplete#enable_at_startup = 1
  " let g:deoplete#auto_complete_delay = 150
" }}}

Am I one who experience that?

Me too. After the pushed fixed, the bug happens less likely but it's still here (at least for me). Setting g:deoplete#auto_complete_delay to 50 or 150 works for me.

I have reproduced the problem if g:deoplete#eable_refresh_always is 1.
So I have changed g:deoplete#auto_complete_delay default value.
It seems complete() bug. But it is not easy to fix.

I had changed the default value recently.
Because, other people said deoplete completion is slow.
I don't think so, but the delay seems long.
So I had changed it...

Unfortunately the problem persists for me, even after the last update (OP of #441). I do not know if I am the only one who keeps having the problem, but my configuration is close to the default one and the plugins I use do not seem to conflict with the deoplete plugin. I have to note however that its frequency has decreased.

This is bug of Vim/neovim.
I will create the patch to fix it.

It depends on your machine speed and your configuration and your input time.
If the problem persists, please change g:deoplete#auto_complete_delay time.

@VasLem I also have this issue. My delay is set to 10, but I'm going to increase it to try to avoid this issue.

Another way to workaround this problem is to set
let g:deoplete#complete_method = "omnifunc" let g:deoplete#auto_complete_delay = 0
so that you get a fast completion.

Meanwhile, could @Shougo reopen this bug open for tracking until the problem is fixed totally?

I opened some random big python sources and it seems that the bug is fixed. I will report if there is any problem.

I'm still seeing it.
On Mon, Mar 27, 2017 at 3:30 AM Yichao Zhou notifications@github.com
wrote:

I opened some random big python sources and it seems that the bug is
fixed. I will report if there is any problem.

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/Shougo/deoplete.nvim/issues/440#issuecomment-289378603,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AH8KTFo0i9XE1yVAyPmLEx49SYx8eOpCks5rp2m6gaJpZM4MOzoR
.

>

  • Alok

@Alok Please test #447.

447 seems to work except that I got this error message editing a markdown file with dictionary completion enabled:

[deoplete] Traceback (most recent call last):
[deoplete]   File "/Users/alokbeniwal/.config/nvim/bundle/deoplete.nvim/rplugin/python3/deoplete/deoplete.py", line 46, in completion_begin
[deoplete]     self.gather_results(context), context['input'])
[deoplete]   File "/Users/alokbeniwal/.config/nvim/bundle/deoplete.nvim/rplugin/python3/deoplete/deoplete.py", line 146, in merge_results
[deoplete]     [x['context']['complete_position'] for x in results
[deoplete] ValueError: min() arg is an empty sequence

@Alok this should fix, or at least work around, it:

diff --git a/rplugin/python3/deoplete/deoplete.py b/rplugin/python3/deoplete/deoplete.py
index ed8ff51..515e0b8 100644
--- a/rplugin/python3/deoplete/deoplete.py
+++ b/rplugin/python3/deoplete/deoplete.py
@@ -139,12 +139,13 @@ class Deoplete(logger.LoggingMixin):
         return self._results.values()

     def merge_results(self, results, context_input):
-        if not results:
-            return (False, -1, [])
-
         complete_position = min(
             [x['context']['complete_position'] for x in results
-             if x['context']['candidates']])
+             if x['context']['candidates']],
+            None)
+
+        if not complete_position:
+            return (False, -1, [])

         candidates = []
         for result in [x for x in results

@Alok I have fixed the error. Please use the latest version.

Fixed.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rafi picture rafi  Â·  4Comments

callmekohei picture callmekohei  Â·  4Comments

tcstory picture tcstory  Â·  5Comments

letharion picture letharion  Â·  5Comments

lowski picture lowski  Â·  3Comments