@@ -90,7 +90,7 @@ M.list = function(opts)
9090 return {}
9191 end
9292 --- @diagnostic disable-next-line : param-type-mismatch
93- local fd = assert (uv .fs_opendir (session_dir , nil , 32 ))
93+ local fd = assert (uv .fs_opendir (session_dir , nil , 256 ))
9494 --- @diagnostic disable-next-line : cast-type-mismatch
9595 --- @cast fd luv_dir_t
9696 local entries = uv .fs_readdir (fd )
@@ -467,6 +467,22 @@ M.load = function(name, opts)
467467 -- Set the options immediately
468468 util .restore_global_options (data .global .options )
469469 end
470+
471+ for ext_name in pairs (config .extensions ) do
472+ if data [ext_name ] then
473+ local ext = util .get_extension (ext_name )
474+ if ext and ext .on_pre_load then
475+ local ok , err = pcall (ext .on_pre_load , data [ext_name ])
476+ if not ok then
477+ vim .notify (
478+ string.format (" [resession] Extension %s on_pre_load error: %s" , ext_name , err ),
479+ vim .log .levels .ERROR
480+ )
481+ end
482+ end
483+ end
484+ end
485+
470486 local scale = {
471487 vim .o .columns / data .global .width ,
472488 (vim .o .lines - vim .o .cmdheight ) / data .global .height ,
@@ -527,11 +543,11 @@ M.load = function(name, opts)
527543 for ext_name in pairs (config .extensions ) do
528544 if data [ext_name ] then
529545 local ext = util .get_extension (ext_name )
530- if ext then
531- local ok , err = pcall (ext .on_load , data [ext_name ])
546+ if ext and ext . on_post_load then
547+ local ok , err = pcall (ext .on_post_load , data [ext_name ])
532548 if not ok then
533549 vim .notify (
534- string.format (' [resession] Extension "%s" load error: %s' , ext_name , err ),
550+ string.format (' [resession] Extension "%s" on_post_load error: %s' , ext_name , err ),
535551 vim .log .levels .ERROR
536552 )
537553 end
0 commit comments