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-buffer'
Plug 'hrsh7th/cmp-nvim-lsp'
Plug 'hrsh7th/vim-vsnip'
Plug 'neovim/nvim-lspconfig'
call plug#end()
PlugInstall | quit
" Setup global configuration. More on configuration below.
lua << EOF
local cmp = require "cmp"
cmp.setup {
view = {
entries = { name = 'custom', selection_order = 'near_cursor' }
},
snippet = {
expand = function(args)
vim.fn["vsnip#anonymous"](args.body)
end,
},
mapping = {
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
else
fallback()
end
end, { "i", "s" }),
},
sources = cmp.config.sources({
{ name = "nvim_lsp" },
{ name = "buffer" },
}),
}
EOF
lua << EOF
local capabilities = require('cmp_nvim_lsp').default_capabilities()
require'lspconfig'.pyright.setup {
capabilities = capabilities,
}
EOF
Description
The documentation window obstructs suggestions window when suggestions window is too wide. This seems to only happen when the windows are set to be bordered and selection_order = 'near_cursor'. See the screenshots below in the "Steps to Reproduce" section.
Steps to reproduce
Ensure the pyright language server is available on the PATH
echo "import sys" > test.py
nvim -u ~/cmp-repro.vim test.py
Drag the window to be narrow width-wise, like in the provided screenshot.
Begin typing in the next line: sys.audit.
Press tab to go to the first result
Observe that the documentation covers the suggestion window. (Note that this does not happen when we don't set cmp.config.window.bordered())
This repros the issue by using an extremely narrow window, but here is an example that can happen with a normal window size when the suggestion window is wide from its long method signatures:
Expected behavior
We do not expect the documentation to cover the suggestion window. When the bordered window is not set, the documentation either does not show or only takes up the space around the suggestions.
Actual behavior
Documentations window blocks the suggestions window. See the screenshot in "Steps to Reproduce" section.
FAQ
Announcement
Minimal reproducible full config
Description
The documentation window obstructs suggestions window when suggestions window is too wide. This seems to only happen when the windows are set to be bordered and
selection_order = 'near_cursor'
. See the screenshots below in the "Steps to Reproduce" section.Steps to reproduce
echo "import sys" > test.py
nvim -u ~/cmp-repro.vim test.py
sys.audit.
cmp.config.window.bordered()
)This repros the issue by using an extremely narrow window, but here is an example that can happen with a normal window size when the suggestion window is wide from its long method signatures:
Expected behavior
We do not expect the documentation to cover the suggestion window. When the bordered window is not set, the documentation either does not show or only takes up the space around the suggestions.
Actual behavior
Documentations window blocks the suggestions window. See the screenshot in "Steps to Reproduce" section.
Additional context
No response