-
-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Session is not AutoCreated on nvim .
#393
Comments
The issue is that nvimtree changes the command line argument before autosession has a chance to see it (changing it from To fix, you can lazy load NvimTree:
return {
'nvim-tree/nvim-tree.lua',
version = '*',
-- lazy = false,
cmd = {
'NvimTreeOpen',
'NvimTreeClose',
'NvimTreeToggle',
'NvimTreeFocus',
'NvimTreeRefresh',
'NvimTreeFindFile',
'NvimTreeFindFileToggle',
'NvimTreeClipboard',
'NvimTreeResize',
'NvimTreeCollapse',
'NvimTreeCollapseKeepBuffers',
'NvimTreeHiTest',
},
-- can use opts instead of a config function
opts = {
sync_root_with_cwd = true,
renderer = {
add_trailing = true,
},
},
}
...
{
-- Main LSP Configuration
'neovim/nvim-lspconfig',
event = { 'BufReadPre', 'BufNewFile' },
dependencies = {
...
{
'rmagatti/auto-session',
lazy = false,
...
opts = {
...
no_restore_cmds = {
function()
require('custom.plugins.utils.barbar-tree-offset').toggle()
end,
},
},
}, |
Thank you so much for your detailed help! Lazy loading nvim-tree definitely helped with the path overwriting issue. I found that to disable lazy loading I had to actively specify lazy = true in my nvim-tree options. |
Glad it's working! If you specify https://lazy.folke.io/spec/lazy_loading |
Describe the bug
A clear and concise description of what the bug is.
When I open a directory with
nvim .
, auto-session does not save the session. See the additional context - i think it is an issue with allow_files_auto_saveTo Reproduce
Steps to reproduce the behavior:
Set the auto_create option to True. cd to a new directory with no saved session named after it. call
nvim .
No session is created on startup (fair I guess, as there's no session to restore). But still no session is saved on close.Expected behavior
A clear and concise description of what you expected to happen.
When I run :q after the "To Reproduce" steps, it should create a new session on save.
Screenshots
If applicable, add screenshots to help explain your problem.
Checkhealth
Paste the contents of
checkhealth auto-session
hereBaseline (please complete the following information):
set sessionoptions?
: sessionoptions=blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal,localoptionsuname -a
:Linux HP-Workstation 6.8.0-48-generic #48~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Mon Oct 7 11:24:13 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
nvim --version
Note that I have disabled a bunch of the config options of auto-session for this bug report, see my checkhealth output.
Additional context
I typically run nvim through neovide, but for this report I have just used the command line to call nvim.
With debug enabled, it looks like auto-session thinks my command line argument is a file, not a directory. (This is just when running
nvim .
)auto-session DEBUG: args_allow_files_auto_save is false, not enabling restoring/saving
Thanks for reading! Let me know if you need anything else :)
The text was updated successfully, but these errors were encountered: