Skip to content

Commit c15a0f9

Browse files
committed
Ignore empty string lines when echo loggings
1 parent f45fdda commit c15a0f9

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

lua/commons/log.lua

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,12 @@ local function log(level, msg)
6666
if LogConfigs.use_console and level >= LogLevels.INFO then
6767
local msg_chunks = {}
6868
for _, line in ipairs(msg_lines) do
69-
table.insert(msg_chunks, {
70-
string.format("[%s] %s", LogConfigs.name, line),
71-
LogHighlights[level],
72-
})
69+
if type(line) == "string" and string.len(line) > 0 then
70+
table.insert(msg_chunks, {
71+
string.format("[%s] %s", LogConfigs.name, line),
72+
LogHighlights[level],
73+
})
74+
end
7375
end
7476
vim.schedule(function()
7577
vim.api.nvim_echo(msg_chunks, false, {})

0 commit comments

Comments
 (0)