rcarriga / nvim-notify

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

String cannot contain newlines #125

Closed Mte90 closed 2 years ago

Mte90 commented 2 years ago

immagine

As you can see... It is possible to trim newlines to avoid this error?

rcarriga commented 2 years ago

Can you show how you're calling notify? It should automatically split on new lines, however if the input is a list, it will not as it assumes that the elements are each a line.

Mte90 commented 2 years ago

It is generated my guess from LSP using php actor but I am not sure what is the source...

rcarriga commented 2 years ago

I can see from the traceback that the call to vim.notify is within your own config in .config/nvim/lua/plugin/lsp.lua. Can you show what that LSP handler looks like?

Mte90 commented 2 years ago

The snippet is the one on https://github.com/neovim/nvim-lspconfig/wiki/User-contributed-tips#use-nvim-notify-to-display-lsp-messages

my dot files: https://github.com/Mte90/dotfiles/blob/master/.config/nvim/lua/plugin/lsp.lua#L168

rcarriga commented 2 years ago

Aha yes that's it. It places it in a list for some reason. Just change { result.message } to result.message and it'll work as expected. I've updated the snippet in the wiki

Mte90 commented 2 years ago

Cool :-)