From ad01579366d998b68857eac6b969c508894252c1 Mon Sep 17 00:00:00 2001 From: JetSetIlly Date: Sat, 20 Jun 2026 18:24:32 +0100 Subject: [PATCH 1/2] removed 'let' from session file content recent releases of vim specify Session files to be vim9script. 'let' is no longer allowed as the assignment operator in vim9script --- plugin/obsession.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin/obsession.vim b/plugin/obsession.vim index e36729d..648095d 100644 --- a/plugin/obsession.vim +++ b/plugin/obsession.vim @@ -75,8 +75,8 @@ function! s:persist() abort execute 'mksession!' fnameescape(tmp) let v:this_session = g:this_obsession let body = readfile(tmp) - call insert(body, 'let g:this_session = v:this_session', -3) - call insert(body, 'let g:this_obsession = v:this_session', -3) + call insert(body, 'g:this_session = v:this_session', -3) + call insert(body, 'g:this_obsession = v:this_session', -3) if type(get(g:, 'obsession_append')) == type([]) for line in g:obsession_append call insert(body, line, -3) From ae2602b70058796a5caad61262fba209b646d3cb Mon Sep 17 00:00:00 2001 From: JetSetIlly Date: Sat, 20 Jun 2026 22:10:14 +0100 Subject: [PATCH 2/2] add check for vim9script directive 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 --- plugin/obsession.vim | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/plugin/obsession.vim b/plugin/obsession.vim index 648095d..ef2a998 100644 --- a/plugin/obsession.vim +++ b/plugin/obsession.vim @@ -75,8 +75,13 @@ function! s:persist() abort execute 'mksession!' fnameescape(tmp) let v:this_session = g:this_obsession let body = readfile(tmp) - call insert(body, 'g:this_session = v:this_session', -3) - call insert(body, 'g:this_obsession = v:this_session', -3) + if body[0] ==# 'vim9script' + call insert(body, 'g:this_session = v:this_session', -3) + call insert(body, 'g:this_obsession = v:this_session', -3) + else + call insert(body, 'let g:this_session = v:this_session', -3) + call insert(body, 'let g:this_obsession = v:this_session', -3) + endif if type(get(g:, 'obsession_append')) == type([]) for line in g:obsession_append call insert(body, line, -3)