vim-matchup
vim-matchup copied to clipboard
Covers statusline if using Neovim's `set cmdheight=0` option
Explain the issue
Neovim supports set cmdheight=0, basically it only shows the command line when you're actively in command mode.
When cmdheight=0, the thing that shows the matching context covers the statusline, instead of being one line above it, like I'd expect. Screenshot below:

Neovim version:
NVIM v0.8.0-dev-926-g779a25f04
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by [email protected]
Features: +acl +iconv +tui
See ":help feature-compile"
system vimrc file: "$VIM/sysinit.vim"
fall-back for $VIM: "/opt/homebrew/Cellar/neovim/HEAD-779a25f_1/share/nvim"
Run :checkhealth for more info
Using Treesitter matching.
Minimal vimrc file
Note that this requires Neovim 0.7.0+. It should automatically bootstrap the plugins for you. Run with nvim -u init.lua
vim.cmd([[set runtimepath=$VIMRUNTIME]])
vim.cmd([[set packpath=/tmp/nvim/site]])
local package_root = "/tmp/nvim/site/pack"
local install_path = package_root .. "/packer/start/packer.nvim"
local function load_plugins()
require("packer").startup({
{
"wbthomason/packer.nvim",
{
"andymass/vim-matchup",
setup = function()
vim.g.matchup_matchparen_offscreen = { method = 'popup' }
end
},
},
config = {
package_root = package_root,
compile_path = install_path .. "/plugin/packer_compiled.lua",
display = { non_interactive = true },
},
})
end
_G.load_config = function()
vim.opt.cmdheight = 0
end
if vim.fn.isdirectory(install_path) == 0 then
print("Installing plugins...")
vim.fn.system({ "git", "clone", "--depth=1", "https://github.com/wbthomason/packer.nvim", install_path })
end
load_plugins()
require("packer").sync()
vim.cmd([[autocmd User PackerComplete ++once echo "Ready!" | lua load_config()]])
Then edit, for example, a JSON file that takes up more than full height, and put your cursor on the first opening {.
It sounds like you prefer to use the popup window instead of the status line:
let g:matchup_matchparen_offscreen = {'method': 'popup'}
Does this resolve the issue?
Sorry, I forgot to put this in the minimal config in the first comment -- I'm already using that. I'll edit the original comment to include that config.
I think it's an issue with computing where the popup appears when set cmdheight=0
very strange, I cannot reproduce it, but I do see a similar problem.
reported: offscreen match covers status line in normal mode, i.e., at bottom most line
observed: in normal mode, looks fine, but when entering command mode, since the status line moves up by one, offscreen match covers status line now (does not move out of the way).
so I can fix (observed) but I am not sure it will solve your issue
In my environment, https://github.com/andymass/vim-matchup/issues/243#issuecomment-1233604415 works with cmdheight=0. Thank you.
Closing this as I can't reproduce it, the popup seems to work fine with cmdheight=0.