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
I have searched the exsiting issues of plugins related to this issue
Neovim version (nvim -v)
v0.9.0-dev-622+g08ebf8d3a
Operating system/version
Linux lawn 6.1.3-arch1-1
Describe the bug
I split up my personal configuration so that the majority of what many people put in ~/.config/nvim/init.lua is in files in ~/.config/nvim/plugins/*.lua. I think this is a moderately-common pattern, and one that NeoVim supports by default.
Since lazy.nvim takes over the process of loading the files in plugins/, it appears that configuration loaded that way no longer outputs print() statements that would normally output at startup (I've also tried vim.cmd('echo "xyz"') too). They don't appear in :messages.
This is not much more than annoying at this stage, since it makes debugging my configuration trickier.
I would assume this is happening because lazy.nvim is pre-compiling this code, and perhaps there is an optimization which removes print()? I'm not sure if this is deliberate, however. Certainly I would argue it's not correct - there are many legitimate reasons to want to print() during startup, even if it's not that common.
Thanks as always for all your hard work on the plugin.
Steps To Reproduce
Create ./.repro/config/nvim/plugins/x.lua containing just print('foo').
Run NeoVim with repro init.lua as below.
Type :messages.
bar is printed from init.lua, but not foo from x.lua.
Expected Behavior
Both foo and bar are printed.
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= {
"folke/tokyonight.nvim",
-- add any other plugins here
}
require("lazy").setup(plugins, {
root=root.."/plugins",
})
vim.cmd.colorscheme("tokyonight")
-- add anything else hereprint('bar')
The text was updated successfully, but these errors were encountered:
Did you check docs and existing issues?
Neovim version (nvim -v)
v0.9.0-dev-622+g08ebf8d3a
Operating system/version
Linux lawn 6.1.3-arch1-1
Describe the bug
I split up my personal configuration so that the majority of what many people put in
~/.config/nvim/init.lua
is in files in~/.config/nvim/plugins/*.lua
. I think this is a moderately-common pattern, and one that NeoVim supports by default.Since lazy.nvim takes over the process of loading the files in
plugins/
, it appears that configuration loaded that way no longer outputsprint()
statements that would normally output at startup (I've also triedvim.cmd('echo "xyz"')
too). They don't appear in:messages
.This is not much more than annoying at this stage, since it makes debugging my configuration trickier.
I would assume this is happening because
lazy.nvim
is pre-compiling this code, and perhaps there is an optimization which removesprint()
? I'm not sure if this is deliberate, however. Certainly I would argue it's not correct - there are many legitimate reasons to want toprint()
during startup, even if it's not that common.Thanks as always for all your hard work on the plugin.
Steps To Reproduce
./.repro/config/nvim/plugins/x.lua
containing justprint('foo')
.init.lua
as below.:messages
.bar
is printed frominit.lua
, but notfoo
fromx.lua
.Expected Behavior
Both
foo
andbar
are printed.Repro
The text was updated successfully, but these errors were encountered: