-
Notifications
You must be signed in to change notification settings - Fork 411
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
Omni Completion (offset?) issues #652
Comments
@zacmar Hm... I can't get |
Here is a working minimal vimrc: if has('vim_starting')
set encoding=utf-8
endif
scriptencoding utf-8
if &compatible
set nocompatible
endif
let s:plug_dir = expand('/tmp/plugged/vim-plug')
if !filereadable(s:plug_dir .. '/plug.vim')
execute printf('!curl -fLo %s/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim', s:plug_dir)
end
execute 'set runtimepath+=' . s:plug_dir
call plug#begin(s:plug_dir)
Plug 'hrsh7th/nvim-cmp'
Plug 'hrsh7th/cmp-omni'
call plug#end()
PlugInstall | quit
lua << EOF
local cmp = require "cmp"
cmp.setup {
mapping = {
['<CR>'] = cmp.mapping.confirm(),
['<Tab>'] = cmp.mapping(function(callback)
if cmp.visible() then
cmp.select_next_item()
else
callback()
end
end)
},
sources = {
{ name = "omni" },
},
}
EOF
|
Here is a small Dockerfile to reproduce this issue: FROM archlinux
RUN pacman -Syu --noconfirm git python neovim python-neovim
WORKDIR /src/cmp_bug2
COPY ./minimal.vim ./
|
FYI @hrsh7th: Check out the Deepl Translator for Japanese->English translation, in my experience this provides better translations than the Google translator :) |
I can reproduce with |
This fixes the truncation at the beginning, but still adds a dot(.) at the end. Is that intentional? |
It's specified by python's omnicomplete. I can't fix this sorry. |
I see, thanks for the answer! |
FAQ
Issues
Neovim Version
NVIM v0.7.0-dev+717-gf37c5f180a
Minimal reproducible config
init.vim
Description
Using the
omni
source doesn't work as intended.Consider
where
|
denotes the cursor. This results inPressing
<C-n>
results inSteps to reproduce
cat > minimal.py << EOF
import numpy
EOF
nvim -u init.vim minimal.py
on<C-n>
Expected behavior
Actual behavior
Additional context
I came across this issue when adding the
omni
source for vimtex. There has been some discussion about offset issues here and here, which might be somehow related.On a side-note, I have noticed that sometimes
(neo)vim
s built-in omni completion for python outperforms thenvim-lsp
source. For instance, when completing function calls, it inserts the(
without me having to type this. Is this innvim-cmp
s control, or does this depend entirely on the completion the language server provides?The text was updated successfully, but these errors were encountered: