bufresize.nvim icon indicating copy to clipboard operation
bufresize.nvim copied to clipboard

bufresize.nvim with trouble.nvim window changes cmdheight upon terminal resize

Open YodaEmbedding opened this issue 2 years ago • 1 comments

Opening and closing Trouble.nvim's quickfix window causes bufresize.nvim to incorrectly change the cmdheight when the terminal pane is resized in tmux.

See video:

622159

https://asciinema.org/a/622159

YodaEmbedding avatar Nov 21 '23 08:11 YodaEmbedding

I fixed this by creating an autocmd that sets the cmdheight back to the original value on event VimResized.

Example with lazy.nvim:

return {
  "kwkarlwang/bufresize.nvim",
  config = function()
    require("bufresize").setup()

    -- Fix cmdheight changing when using trouble.nvim
    vim.g.cmdheight = vim.o.cmdheight
    vim.api.nvim_create_autocmd("VimResized", {
      callback = function()
        vim.o.cmdheight = vim.g.cmdheight
      end
    })
  end,
}

forkd4x avatar May 12 '25 19:05 forkd4x