From 0cb572a83787a88c8e6ef30aec148d509902a659 Mon Sep 17 00:00:00 2001 From: sxyazi Date: Wed, 21 Feb 2024 02:28:41 +0800 Subject: [PATCH] feat: `state` now accepts a name for the bucket --- yazi-plugin/preset/state.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yazi-plugin/preset/state.lua b/yazi-plugin/preset/state.lua index 2c7ee591..8d0e4d59 100644 --- a/yazi-plugin/preset/state.lua +++ b/yazi-plugin/preset/state.lua @@ -21,5 +21,5 @@ state = setmetatable({}, { cache[bucket] = cache[bucket] or {} cache[bucket][k] = v end, - __call = function() return setmetatable({ __yazi_bucket = YAZI_PLUGIN_NAME }, sub_mt) end, + __call = function(_, name) return setmetatable({ __yazi_bucket = name or YAZI_PLUGIN_NAME }, sub_mt) end, })