Neovim: Also silence errors.

This commit is contained in:
Dmitry Voronin 2024-10-16 16:18:03 +03:00
parent 91563c4b08
commit 58f3680d3c
Signed by: voronind
SSH key fingerprint: SHA256:3kBb4iV2ahufEBNq+vFbUe4QYfHt98DHQjN7QaptY9k

View file

@ -5,12 +5,15 @@
-- Disable error messages popup. -- Disable error messages popup.
-- Instead print them and write to /tmp/NeovimError<PID>.txt -- Instead print them and write to /tmp/NeovimError<PID>.txt
vim.notify = function(msg, log_level, opts) bequiet = function(msg, log_level, opts)
print(string.sub(msg, 1, vim.v.echospace)) print(string.sub(tostring(msg), 1, vim.v.echospace))
local file = io.open("/tmp/NeovimError"..tostring(pid)..".txt", "a") local file = io.open("/tmp/NeovimError"..tostring(pid)..".txt", "a")
file:write(msg.."\n") file:write(msg.."\n")
file:close() file:close()
end end
vim.notify = bequiet
vim.api.nvim_err_writeln = bequiet
''; '';
} }