-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
sessions: do not save mappings defined in vim9script context #16738
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
base: master
Are you sure you want to change the base?
Conversation
- fixes Comment plugin loses state when Session loads #16549
- fixes Session restoration breaks mappings #16688
Hm, that sounds a bit brutal. If someone uses vimrc usig vim9script all mappings won't be restored? Wouldn't it be cleaner to add |
I don’t think it would, the issue is not in optional packages but in the way session is saved and restored. Adding packadd will do nothing for a mapping that uses function coming from vim9script import. |
There might be a better way, but I can’t see it. Check #16688 |
In any case, can you please add a test for this? |
I'd like to hear others opinions. |
Let's wait for other opinions and if it would be "a go", will add test(s) |
What I was thinking with this implementaion/fix:
|
added 2 tests: for mappings defined in and out of vim9script context. |
Oh, I've forgot branch deletion would close the pr too. @chrisbra should I restore it? |
Ah thanks. I didn't notice earlier. Let's leave it open for now. Thanks |
Fixing sessions from breaking I was about to create an issue today, having been driven crazy and wasting loads of time debugging why a plugin's Workaround? An autocmd SessionWritePost * FixSessionFile()
def FixSessionFile(): void
try
v:this_session
->readfile('b')
->filter('v:val !~ "<ScriptCmd>"')
->writefile(v:this_session, 'b')
catch
echo v:exception
endtry
enddef |