-
-
Notifications
You must be signed in to change notification settings - Fork 53
[BUG] filetype doesn't get restored after change of directory #204
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
Comments
Hi, custom filetypes are not something that gets saved in sessions in Neovim. Which is why I mentioned on the last issue that you'd have to use a hook to set a particular filetype, or even configure Neovim to always associate a particular file extension to a particular filetype of your choice. You are setting the filetype manually, right? |
It is not about "custom" filetypes, here, but just the "normal", "standard" ones like yes, I have to set any filetype manually (or using I can't imagine this being the intended behavior. As I am just starting with |
Right. You mention there are not many plugins that would influence filetype detection, auto-session is also not one of them. It just uses the underlying session creation and loading capabilities from Neovim. Something you can try is:
Do you still see the issue happening? |
I did this:
and the filetype is restored, so I see the Python coloring. So, there does not seem to be an issue within the built-in session management. |
one thing is odd, though: when I create a session file for the default nvim binary folder (in my case it is at
then, when I start nvim, the session is loaded and the filetype from this session is loaded, correctly. But as soon as I use the |
Have you set |
yes, I have and had (as mentioned in #205). But this should not influence the missing colors, anyway, I would think. It is odd that restoration of colors works in the first place (when starting nvim and auto-loading the session respective to the current folder) but fails on all subsequent folder changes. |
post_restore_cmds = {
function()
vim.api.nvim_exec2("edit", {})
end,
}, |
i was running into this issue, and it appears to have been fixed by adding |
@nnako it's probably worth trying out @apaleslimghost's findings here if you haven't already |
I just came across this and can confirm that this solves the issue:
Thanks @apaleslimghost |
Seems like we should add a check for that and pop up a warning if localoptions isn't present. I'll look into that |
After starting nvim and creating some tabs containing some buffers with different language files (all the same files will work as well), I use the command
cd
to walk into a specific project folder. After that, I issue the commandSaveSession
. This leads to creating a vim file within the default folder... / nvim-data / sessions / ...
. This file contains all the settings to restore the session.Now, after closing vim, restarting it and
cd
-ing into the folder from the last session, all the buffers get restored into the appropriate tabs. BUT: thefiletype
is lost. issuing the command:set filetype
results in an empty string.The expected behavior would be to see the filetypes restored for all the buffers / tabs. Not to be obliged to manually re-set all the
filetypes
.Baseline
Windows 10
:v0.9.0
what could this be? Is this not the expected behavior? is it maybe a configuration issue?
The text was updated successfully, but these errors were encountered: