Open guoang opened 1 year ago
i believe lua tables are passed by reference so alpha.current_state = current_state
would suffice, can i ask what you're trying to do? just out of curiosity
i believe lua tables are passed by reference so
alpha.current_state = current_state
would suffice, can i ask what you're trying to do? just out of curiosity
This looks good to me too. What I need is to access current_state
in my vim config, I currently can't do that since current_state
is a local variable.
the reason i'm asking what specifically you're trying to do is because you can already access the state by extending the layout_element
and keymaps_element
tables which is a bit more principled. if you're not actually defining a new element type then i'm curious y you need the state.
also the api just changed a little to accommodate multiple concurrent alpha configs
https://github.com/goolord/alpha-nvim/blob/main/lua/alpha.lua#L17-L18
but this could still be done
@goolord for context I'm looking into this too, the reason I want the state available would be because when I open a new session I want to be able to say "If and only if alpha is not already open, open alpha", since the start
command also closes alpha and is more of a toggle. Alternatively, making start
idempotent would also work
I'm trying to write my own theme and need this interface.