goolord / alpha-nvim

a lua powered greeter like vim-startify / dashboard-nvim
MIT License
1.73k stars 101 forks source link

Highlight not working for new lines #254

Closed rajvatsal closed 6 months ago

rajvatsal commented 6 months ago
          i did not inspect the fortune pr thoroughly enough ' _ '

basically the problem is that fortune was returning a string with newlines in it, which is prone to all sorts of nasty bugs so i decided newlines will be delimited by indices in a table

Originally posted by @goolord in https://github.com/goolord/alpha-nvim/issues/40#issuecomment-946214457 I've created a function that returns a random string each time nvim starts and set it's value footer.val. That string has '\n\ some new lines and therefore highlighting doesn't work. I found this reference issue where you fix it for fortune. How can I do the same for my custom function?

goolord commented 6 months ago

instead of returning a string with newlines in it, return a table of strings split on newlines. then when you go to highlight the string, newline characters won't be highlighted