Closed Coien-rr closed 1 year ago
this might be not work with dashboard command you should dump it in cache.
I try to fix it and use os.time()
to test it, it seems work fine.
and i have an additional question that if set footer as
footer = {
"test",
"123",
"test",
},
this first item will not been set highlight like that
Is this for more customization freedom, or just set for blank line
it fixed just now. did you try run it from dashboard comand ? you don't cache it in cache_opts function . so this might be broken on command.
i use Dashboard
to return dashboard from file window
no error and the change in the result of the os.time()
proves that the function was called again
you don't cache it in cache_opts function .
yep ... i just try to call function again...(maybe it is not great enough for unchange result :(
you can take a look at the cache_opts
function . do like what i do in this function. when it's a function dump it to a byte code then dashboard can cache it to file. otherwise it will report an error.
if self.opts.config.footer and type(self.opts.config.footer) == 'function' then
---@diagnostic disable-next-line: param-type-mismatch
local dump = assert(string.dump(self.opts.config.footer))
self.opts.config.footer = dump
end
i found this snippet in cache_opts
function, so you have finished serializing the function, I just need to reload the function and execute it by loadstring()
:)
you found it :) then do it.
sorry :(, i don't understand your idea
In my understanding, a function dump it to a byte code as first enter, When using Dashboard
to retrieve it from the cache again, it has become a string, so it can be executed as long as it is converted to func by loadstring()
And you've already done the transcode storage task, I don't think I'll have to do it again 😵💫
hmm i forget i already dump it…
make hyper footer support function type
additionally tiny change to #289