Neovim: Also print errors to display.

This commit is contained in:
Dmitry Voronin 2024-10-15 04:23:18 +03:00
parent 14f818974a
commit 897be283a5
Signed by: voronind
SSH key fingerprint: SHA256:3kBb4iV2ahufEBNq+vFbUe4QYfHt98DHQjN7QaptY9k

View file

@ -1,10 +1,13 @@
{ ... }:
{
text = ''
pid = vim.fn.getpid()
-- Disable error messages popup.
-- Instead write them to /tmp/NeovimError<PID>.txt
-- Instead print them and write to /tmp/NeovimError<PID>.txt
vim.notify = function(msg, log_level, opts)
local pid = vim.fn.getpid()
print(string.sub(msg, 1, vim.v.echospace))
local file = io.open("/tmp/NeovimError"..tostring(pid)..".txt", "a")
file:write(msg.."\n")
file:close()