rcarriga / nvim-notify

A fancy, configurable, notification manager for NeoVim
MIT License
2.97k stars 78 forks source link

notification message wrap at max_width when wrap_message is set true #143

Closed DariusCorvus closed 1 year ago

DariusCorvus commented 1 year ago

Hello

I missed a parameter to wrap messages at the max_width for messages.

The reason for such a parameter would be to wrap messages that a from vim.notify
when it is overwritten with require ("notify").

Long story short i implemented the parameter wrap_message.


notify.setup {
  wrap_message = true,
  max_width = 80,
}

When the parameter wrap_message is set to true and passed into the notify setup, messages are split at a string length of max_width.

rcarriga commented 1 year ago

Appreciate the PR but I've already rejected adding this type of feature in https://github.com/rcarriga/nvim-notify/issues/129. I don't want nvim-notify to change the message in any way as I'd like to keep it simple in the core and allow extending it instead.

There is no perfect solution for this:

So I'm happy for an entry to be added to the wiki to show users how they could do this but (at least for the foreseeable future) I won't be adding this to the plugin. If you do wish to add to the wiki, be aware that your implementation doesn't handle newlines in the message or messages already passed in as a list.