feat: allow setting order from setup (#17)
Co-authored-by: sxyazi <sxyazi@gmail.com>
This commit is contained in:
@@ -47,6 +47,9 @@ local save = ya.sync(function(st, states)
|
||||
end)
|
||||
|
||||
local function setup(st, opts)
|
||||
opts = opts or {}
|
||||
opts.order = opts.order or 1500
|
||||
|
||||
st.states = {}
|
||||
local styles = {
|
||||
["M"] = THEME.git_modified and ui.Style(THEME.git_modified) or ui.Style():fg("blue"),
|
||||
@@ -59,11 +62,11 @@ local function setup(st, opts)
|
||||
Linemode:children_add(function(self)
|
||||
local state = st.states[tostring(self._file.url)]
|
||||
if state then
|
||||
return ui.Line { ui.Span(" "), ui.Span(state):style(styles[state]), ui.Span(" ") }
|
||||
return ui.Line { ui.Span(" "), ui.Span(state):style(styles[state]) }
|
||||
else
|
||||
return ui.Line {}
|
||||
end
|
||||
end, 5000)
|
||||
end, opts.order)
|
||||
end
|
||||
|
||||
local function fetch(self)
|
||||
|
||||
Reference in New Issue
Block a user