From 897be283a59a50ebd172bd31e88a73c2efe63bf3 Mon Sep 17 00:00:00 2001 From: Dmitry Voronin Date: Tue, 15 Oct 2024 04:23:18 +0300 Subject: [PATCH] Neovim: Also print errors to display. --- home/config/nvim/module/config/Notify.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/home/config/nvim/module/config/Notify.nix b/home/config/nvim/module/config/Notify.nix index f9a4354..fc8b344 100644 --- a/home/config/nvim/module/config/Notify.nix +++ b/home/config/nvim/module/config/Notify.nix @@ -1,10 +1,13 @@ { ... }: { text = '' + pid = vim.fn.getpid() + -- Disable error messages popup. - -- Instead write them to /tmp/NeovimError.txt + -- Instead print them and write to /tmp/NeovimError.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()