rcarriga / nvim-notify

A fancy, configurable, notification manager for NeoVim
MIT License
3k stars 80 forks source link

Feature request: make border style an option in setup() #60

Closed folliehiyuki closed 2 years ago

folliehiyuki commented 2 years ago

border = "rounded" is currently hardcoded in different places.

It would be nice to have a variable, and even better if it is configurable with an option in setup() function.

rcarriga commented 2 years ago

You can already do this with the on_open setup option

  require("notify").setup({
    on_open = function (win)
      vim.api.nvim_win_set_config(win, { border = "double" })
    end,
  })
folliehiyuki commented 2 years ago

Oh I didn't think about it :) Closing then.

Thanks for the help!

danielo515 commented 1 year ago

Never thought about doing it this way

schoblaska commented 1 year ago

@rcarriga If { border = "none" } is set, it seems like the space for the border is still allocated in the rendered notifications. Is there a way to collapse these empty rows / cols so that multiple notifications take up less vertical space?

Current behavior:

image

What I'd like to achieve:

Untitled 2
rcarriga commented 1 year ago

There was a bug in sizing windows without borders which should be fixed now. You'll see still the windows shift initially as they are created with borders. To prevent that, you need to provide custom stages to create the window with no border. Here's a sample

  local base_stages = require("notify.stages.fade_in_slide_out")("bottom_up")
  local notify = require("notify")

  notify.setup({
    render = "minimal",
    stages = {
      function(...)
        local opts = base_stages[1](...)
        if opts then
          opts.border = "none"
        end
        return opts
      end,
      unpack(base_stages, 2),
    },
  })
schoblaska commented 1 year ago

Thanks for the detailed answer and for the excellent plugin! The new compact rendering style looks great, too.