1
0
mirror of https://github.com/jiriks74/presence.nvim synced 2024-11-23 20:37:50 +01:00

Escape newlines in logger

This commit is contained in:
Andrew Kwon 2021-04-28 21:42:22 -07:00
parent c061fdab11
commit 9bae4debba

@ -26,8 +26,10 @@ for i = 1, #Log.levels do
end
vim.schedule(function()
local escaped_message = vim.fn.escape(message, '"'):gsub("\n", "\\n")
vim.cmd(string.format("echohl %s", hl))
vim.cmd(string.format([[echom "[%s] %s"]], "presence.nvim", vim.fn.escape(message, '"')))
vim.cmd(string.format([[echom "[%s] %s"]], "presence.nvim", escaped_message))
vim.cmd("echohl NONE")
end)
end