robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
32aee065a8
master
1local M ={} 2 3--- Checks that the logfile is accessible. 4function M . check_log_file () 5if vim . fn . mode () == 'c' then -- Ex mode 6return 7end 8 9local wanted =vim . fn . getenv ( '__NVIM_LOG_FILE_WANT' ) 10if not wanted or wanted == vim . NIL then 11return 12end 13 14local actual =vim . fn . getenv ( 'NVIM_LOG_FILE' ) 15 16local msg --[[@type string]] 17if not actual or actual == vim . NIL or actual == '' then 18msg =( 'log: %q not accessible, logging disabled (stderr)' ): format ( wanted ) 19elseif actual ~= wanted then 20msg =( 'log: %q not accessible, logging to: %q' ): format ( wanted , actual ) 21else 22return 23end 24 25vim . defer_fn ( function () 26vim . notify ( msg , vim . log . levels . WARN ) 27end , 100 ) 28end 29 30return M