sindrets / diffview.nvim

Single tabpage interface for easily cycling through diffs for all modified files for any git rev.
Other
3.57k stars 101 forks source link

win_opts for help window #431

Closed MariaSolOs closed 8 months ago

MariaSolOs commented 8 months ago

Hello! I'm not sure if this is a feature request or if it's already possible. I promise that I've reviewed the docs but I haven't been able to figure it out... I would like to set rounded borders for the floating help windows only. However I'm only seeing win_opts settings for the other views, so I don't know how to achieve this.

MariaSolOs commented 8 months ago

Nvm, I was able to achieve this with require('diffview.ui.panel').Panel.default_config_float.border = 'rounded'.

sindrets commented 8 months ago

I think auto commands are probably a better fit for making customizations like this, without having to reach into the internal plugin API:

vim.api.nvim_create_autocmd({ "BufWinEnter" }, {
  pattern = "diffview:///panels/*",
  callback = function()
    if vim.api.nvim_win_get_config(0).zindex then
      vim.api.nvim_win_set_config(0, { border = "rounded" })
    end
  end,
})
MariaSolOs commented 8 months ago

@sindrets oh nice! Thank you for the hint <3