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

Account for offset when nvim-tree is opened on the right

Open dlvhdr opened this issue 1 year ago • 0 comments

Is your feature request related to a problem? Please describe. I'm using nvim-tree on the right side, so it doesn't shift my code when I open it. The issue is that in this case, the messages are overlapping with it.

image

Describe the solution you'd like A way to dynamically tell Noice where to place messages. I imagine something like:

local nvim_tree_shift = {
  function()
    local name = "ï­„ Nvim Tree"
    local empty_space = string.rep(" ", ((vim.api.nvim_win_get_width(tree_view.get_winnr()) - #name) / 2))
    return empty_space .. name .. empty_space
  end,
  cond = tree_view.is_visible,
}

require('noice').setup({
  views = {
    mini = {
      column = nvim_tree_shift,
    }
  },
})

dlvhdr avatar Oct 29 '22 15:10 dlvhdr