Removed 'let' from session file content#87
Conversation
recent releases of vim specify Session files to be vim9script. 'let' is no longer allowed as the assignment operator in vim9script
"Older" as in a month or two. I don't even have any machines running the new version yet. Plus there's Neovim compatibility. This needs to be backwards compatible. There's also a hard-coded check for the old-style file that needs to be addressed: vim-obsession/plugin/obsession.vim Line 40 in f50baec That check in and of itself may offer a clue how to distinguish between the old format and new. |
if the first line of the session file is vim9script then use the appropriate assignment syntax. if vim9script is not present then use the original vimscript syntax
I've added a check for the I've tested with an older version (from a couple of months ago)
Of course, loading a new session file with an older version of vim does not work. But that's expected and not something we can account for. I don't have access to neovim so that remains untested. |
Reecent releases of vim specify Session files to be vim9script. 'let' is no longer allowed as the assignment operator in vim9script
This change is all that's needed for Obsession to function without warning messages in recent builds or vim. It would be further improved if the plugin could somehow discern that the session file is using vim9script. That way, people who are still using older versions of vim can still use the most recent version of the plugin.
However, I'm not sure how to do that best so I've not attempted it.
I raised the issue in the main vim repository vim/vim#20588