You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When starting-up nvim with colorscheme nightfox (only the first time, running colorscheme second time changed the colors) or running :NightfoxCompile, I've got the 'ol familiar error: attempt to reference local 'file' which is nil. (line 98 of compiler.lua).
Turns out (I think) I've ran sudo nvim the first time after installing nightfox to edit some system file. As such, cache directory was created under root, and io.open(output_file, "wb") failed due to lacking permissions.
It would've been nice to have a bit of error handling on line 21, so that at least the reason for impossibility of opening a file was surfaced to the end user:
localfile, err=io.open(output_file, "wb")
ifnotfilethenrequire("nightfox.lib.log").error(fmt(
[[Couldn't open %s: %s.Check that %s is accessible for the current user.You could try deleting %s to reset permissions]],
output_file,
err,
output_file,
output_path
))
returnend
Not sure this is worth handling, since the steps required to get into such a debacle are really niche, but I thought this was worth reporting anyways.
Steps To Reproduce
sudo nvim
:PackerSync
colorscheme nightfox
Relaunch neovim as unprivileged user
*Profit*
Expected Behavior
Jus surface the error from the io.open. Would've pointed towards solving the issue right away.
Repro
-- DO NOT change the paths and don't remove the colorschemelocalroot=vim.fn.fnamemodify("./.repro", ":p")
-- set stdpaths to use .reprofor_, nameinipairs({ "config", "data", "state", "cache" }) dovim.env[("XDG_%s_HOME"):format(name:upper())] =root.."/" ..nameend-- bootstrap lazylocallazypath=root.."/plugins/lazy.nvim"ifnotvim.loop.fs_stat(lazypath) thenvim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath })
endvim.opt.runtimepath:prepend(lazypath)
-- install pluginslocalplugins= {
{
"EdenEast/nightfox.nvim",
config=function()
require("nightfox").setup({
-- setup here ...
})
end,
},
-- add any other plugins here
}
require("lazy").setup(plugins, {
root=root.."/plugins",
})
vim.cmd.colorscheme("nightfox")
The text was updated successfully, but these errors were encountered:
Thanks for pointing this out. I have created a patch with the suggested changes. Could you let me know if this solves your issue. (Only have access to a machine currently that does not have nvim accessible though root, wsl with nix and home-manager).
Neovim version (nvim -v)
v0.9.1
Operating system/version
MacOS 13.5.1
Describe the bug
When starting-up nvim with
colorscheme nightfox
(only the first time, runningcolorscheme
second time changed the colors) or running:NightfoxCompile
, I've got the 'ol familiarerror: attempt to reference local 'file' which is nil
. (line 98 ofcompiler.lua
).Turns out (I think) I've ran
sudo nvim
the first time after installing nightfox to edit some system file. As such, cache directory was created under root, andio.open(output_file, "wb")
failed due to lacking permissions.It would've been nice to have a bit of error handling on line 21, so that at least the reason for impossibility of opening a file was surfaced to the end user:
Not sure this is worth handling, since the steps required to get into such a debacle are really niche, but I thought this was worth reporting anyways.
Steps To Reproduce
sudo nvim
:PackerSync
colorscheme nightfox
Expected Behavior
Jus surface the error from the
io.open
. Would've pointed towards solving the issue right away.Repro
The text was updated successfully, but these errors were encountered: