Deoplete.nvim: Completions from other buffers

Created on 12 Apr 2016  路  18Comments  路  Source: Shougo/deoplete.nvim

Problems summary

Completions from other buffers works only when you previously edit(current session) unfocused buffer.
Vim with almost identical config and neocomplete works fine.
Even <C-x><C-p> doesn't help, because it shows nothing, but if you first delete one letter with <BS> when there is no pum(you don't need to delete when pum didn't popup for a current word), then you can complete from other buffers with <C-p> only for this word.

Expected

deoplete should complete words from other buffers atleast for buffers with same filetype(related to doc)

Environment Information

Linux 4.4.5-1-ARCH SMP PREEMPT Thu Mar 10 07:38:19 CET 2016 x86_64 GNU/Linux

  • OS:
  • Neovim version:
    0.1.3 with python3-neovim 0.1.7

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

" Your minimal init.vim
set runtimepath+=~/path/to/deoplete.nvim/
let g:deoplete#enable_at_startup = 1

The reproduce ways from neovim starting (Required!)

  1. With mininal init.vim open two files in nvim
    :e /path/to/file1.txt or any other filetype
    :e /path/to/file2.txt same filetype
  2. file1.txt must have some content, file2.txt can be empty.
  3. Do not edit file1.txt, then try to type some words in file2.txt from file1.txt

Most helpful comment

I have fixed it. Please use the latest version.

All 18 comments

yeah,can confirm,deoplete's buffer source can not load words from file1.txt,but neocomplete works well

EDIT: but in neovim,ctrl+p can complete words from file1.txt,it is same as vim ,and no issues.

Implemented.

@Shougo thanks for your work

@Shougo Thank you a lot. Works for me.
But seems like there is a problem with refreshing(screen blinks, even with vb disabled) when deoplete can't find completions for a current word. I will open a new issue.

same problem with latest deoplete.

Environment Information

  • deoplete version (SHA1):
    8aef99a951686488c03070d1cf1a2155837f5f1b
  • OS:
    Linux 5.6.2-arch1-2 #1 SMP PREEMPT Sun, 05 Apr 2020 05:13:14 +0000 x86_64 GNU/Linux

  • neovim/Vim :version output:

NVIM v0.4.3
Build type: Release
LuaJIT 2.0.5
Compilation: /usr/bin/cc -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -O2 -DNDEBUG -DMIN_LOG_LEVEL=3 -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu
99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fdiagnostics-color=always -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNV
IM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -I/build/neovim/src/build/config -I/build/neovim/src/neovim-0.4.3/src -I/usr/include -I/build/neovim/src/build/src/nvim/auto -I/b
uild/neovim/src/build/include
Compiled by builduser

Features: +acl +iconv +tui
  • :checkhealth or :CheckHealth result(neovim only):
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: $SSH_TTY='/dev/pts/1'

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:
          /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.8 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.8.3
  - INFO: pynvim version: 0.4.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.

health#deoplete#check
========================================================================
## deoplete.nvim
  - 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
  - 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

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

set runtimepath+=~/.config/nvim/plugged/deoplete.nvim/
let g:deoplete#enable_at_startup = 1

Please upload the reproduce instruction.
If not, I will ignore your report.

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

  1. open file1, do nothing or input words without :w
  2. open file2, try to input word prefix of file1, no expected completion pop-up

    1. switch to file1, :w and switch back to file2, completion pop-up

Please don't use "open files" description.
It must be Vim commands.

"switch to file1" is also fuzzy instruction.
It is not reproduce-able for me.

Can you ignore your report??

Please see original reproduce instruction.
Please compare your one.

I ignore the fuzzy instruction.

sorry about fuzzy instruction.

  1. nvim file1.txt
  2. :vs file2.txt
  3. try to input word prefix of file1.txt, no expected completion pop-up
  4. <C-w>w switch to file1.txt, :w
  5. <C-w>w switch to file2.txt, repeat step 3, completion pop-up

OK. So I get it.
I will fix it later.

I have fixed it.

I have fixed it.

Thanks, it works!

btw, is it able for deoplete to auto complete unsaved changes in other buffers?

reproduce steps:

  1. nvim
  2. :e file1, write some words without :w
  3. :vs file2, input word of file1, no expected completion pop-up

OK. I have added the support.
Please use the latest version.

OK. I have added the support.
Please use the latest version.

seems doesn't work, have use the latest version.

commit 3c57b8405d595ad0bc7bfa46f757cce0e8258fbb (HEAD -> master, origin/master, origin/HEAD)
Author: Shougo Matsushita <[email protected]>
Date:   Fri May 29 16:37:41 2020 +0900

    Add InsertLeave autocmd

I have fixed it. Please use the latest version.

I have fixed it. Please use the latest version.

It rocks! Thanks to fix it, it bothers me for a bit of long time.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

marcus picture marcus  路  6Comments

nikitavoloboev picture nikitavoloboev  路  3Comments

tcstory picture tcstory  路  5Comments

ChristianChiarulli picture ChristianChiarulli  路  5Comments

iscekic picture iscekic  路  6Comments