feat: notify [NvimTree] prefix is multiline only if the message is multiline (#2453)
* feat: notify [NvimTree] prefix is multiline only if the message is multiline * feat: notify [NvimTree] prefix is multiline only if the message is multiline
This commit is contained in:
parent
53b0bcaada
commit
e64a498a5e
@ -27,13 +27,14 @@ local modes = {
|
|||||||
|
|
||||||
do
|
do
|
||||||
local dispatch = function(level, msg)
|
local dispatch = function(level, msg)
|
||||||
if level < config.threshold then
|
if level < config.threshold or not msg then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
vim.schedule(function()
|
vim.schedule(function()
|
||||||
if not M.supports_title() then
|
if not M.supports_title() then
|
||||||
msg = "[NvimTree]\n" .. msg
|
-- add title to the message, with a newline if the message is multiline
|
||||||
|
msg = string.format("[NvimTree]%s%s", (msg:match "\n" and "\n" or " "), msg)
|
||||||
end
|
end
|
||||||
|
|
||||||
vim.notify(msg, level, { title = "NvimTree" })
|
vim.notify(msg, level, { title = "NvimTree" })
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user