Skip to content

view.entries.name = "wildmenu" causes window border settings to be ignored using vim.opt.winborder instead. #2223

@flip-rossi

Description

@flip-rossi

FAQ

  • I have checked the FAQ and it didn't resolve my problem.

Announcement

Minimal reproducible full config

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-cmdline'
Plug 'hrsh7th/cmp-buffer'
Plug 'hrsh7th/vim-vsnip'
call plug#end()
PlugInstall | quit

""""""""""""" RELEVANT PART STARTS HERE """""""""""""

set winborder=single

lua << EOF
local cmp = require "cmp"
cmp.setup({
  snippet = {
    expand = function(args)
      vim.fn["vsnip#anonymous"](args.body)
    end,
  },
  sources = cmp.config.sources({
    { name = 'buffer' },
    { name = 'path' },
    { name = 'cmdline' },
  }),
  ----------------- THIS WORKS -----------------
  window = { completion = { border = "none", }, documentation = { border = "none", } },
})

cmp.setup.cmdline({ ':' }, {
  mapping = cmp.mapping.preset.cmdline(),
  sources = {
    { name = 'buffer' },
    { name = 'path' },
    { name = 'cmdline' },
  },
  view = { entries = { name = 'wildmenu', separator = ' | ' } },
  ----------------- THIS IS IGNORED (because of wildmenu) -----------------
  window = { completion = { border = "none", }, documentation = { border = "none", } },
})
EOF

Description

Setting window borders view.entries.name = "wildmenu" causes window border settings to be ignored using vim.opt.winborder instead. This is especially frustrating for cmdline completions, where any border you set on your global vim options will cover what you're typing.

Steps to reproduce

Load the above config, which sets vim.opt.winborder to "single" and start typing some : command. Then execute :set winborder=none and try again.

Expected behavior

Image

Actual behavior

Image

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions