-
After reading this discussion I have removed auto_session.setup({
...
auto_session_allowed_dirs = {
"~/.dotfiles",
"/media/" .. os.getenv("ME") .. "/WindowsD/Coding/*"
},
...
}) But neither the |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 8 replies
-
Hmm, that should be how it works. Can you:
|
Beta Was this translation helpful? Give feedback.
-
Here is my full configuration return {
"rmagatti/auto-session",
config = function()
local auto_session = require("auto-session")
vim.o.sessionoptions = "blank,buffers,curdir,folds,tabpages,winsize,winpos,terminal,localoptions"
auto_session.setup({
log_level = "info",
auto_save_enabled = true,
auto_restore_enabled = true,
auto_session_allowed_dirs = {
"~/.dotfiles",
"/media/" .. os.getenv("ME") .. "/WindowsD/Coding/*"
},
cwd_change_handling = {
restore_upcoming_session = true,
}
})
end
} I am actually on Linux, but I keep some of my code on Windows Partition to access it also on Windows. Here is my log for an directory in Coding folder 2024-08-14T11:42:12 DEBUG auto-session DEBUG: Lazy is loaded, but not visible, will try to restore session
2024-08-14T11:42:12 DEBUG auto-session DEBUG: enabled_for_command_line_argv, launch_argv: {}
2024-08-14T11:42:12 DEBUG auto-session DEBUG: No arguments, saving/restoring enabled
2024-08-14T11:42:12 DEBUG auto-session DEBUG: find_matching_directory {
dirToFind = "/media/kirill/WindowsD/Coding/Projects/PLAYAREA-Spotify/vue",
dirs = {}
}
2024-08-14T11:42:12 DEBUG auto-session DEBUG: suppress_session didn't find a match, returning false
2024-08-14T11:42:12 DEBUG auto-session DEBUG: RestoreSessionFromDir start { "/home/kirill/.local/share/nvim/sessions/" }
2024-08-14T11:42:12 DEBUG auto-session DEBUG: RestoreSessionFromDir validated session_dir: /home/kirill/.local/share/nvim/sessions/
2024-08-14T11:42:12 DEBUG auto-session DEBUG: get_session_file_name no session_name, using cwd: /media/kirill/WindowsD/Coding/Projects/PLAYAREA-Spotify/vue
2024-08-14T11:42:12 DEBUG auto-session DEBUG: RestoreSessionFromDir escaped session name: %2Fmedia%2Fkirill%2FWindowsD%2FCoding%2FProjects%2FPLAYAREA-Spotify%2Fvue.vim
2024-08-14T11:42:12 DEBUG auto-session DEBUG: RestoreSessionFile restoring session from: /home/kirill/.local/share/nvim/sessions/%2Fmedia%2Fkirill%2FWindowsD%2FCoding%2FProjects%2FPLAYAREA-Spotify%2Fvue.vim
2024-08-14T11:42:12 DEBUG auto-session DEBUG: Config at start of setup {
conf = {
args_allow_files_auto_save = false,
args_allow_single_directory = true,
auto_restore_enabled = true,
auto_restore_lazy_delay_enabled = true,
auto_save_enabled = true,
auto_session_allowed_dirs = { "~/.dotfiles", "/media/kirill/WindowsD/Coding/*" },
auto_session_create_enabled = true,
auto_session_enable_last_session = false,
auto_session_enabled = true,
auto_session_root_dir = "/home/kirill/.local/share/nvim/sessions/",
auto_session_use_git_branch = false,
close_unsupported_windows = true,
cwd_change_handling = {
restore_upcoming_session = true
},
log_level = "debug",
session_lens = {
buftypes_to_ignore = {},
load_on_setup = true,
mappings = {
alternate_session = { "i", "<C-S>" },
delete_session = { "i", "<C-D>" }
},
session_control = {
control_dir = "/home/kirill/.local/share/nvim/auto_session/",
control_filename = "session_control.json"
}
},
silent_restore = true
}
}
2024-08-14T11:42:12 DEBUG auto-session DEBUG: Root dir set to: /home/kirill/.local/share/nvim/sessions/
2024-08-14T11:42:12 DEBUG auto-session DEBUG: Loading session lens on setup
2024-08-14T11:42:12 ERROR auto-session ERROR: Error restoring session, disabling auto save.
Set silent_restore = false in the config for a more detailed error message.
Error: E116: Invalid arguments for function dictwatcherdel
2024-08-14T11:42:12 DEBUG auto-session DEBUG: No session restored, call no_restore hooks |
Beta Was this translation helpful? Give feedback.
ah, yes. as it is currently, it expects exact directory matches (rather than doing a substring match) so if you have
/some/dir/*
it'll match/some/dir/proj
but not/some/dir/proj/subdir
Are you still getting an error when restoring your session or did that resolve itself?