Custom status bar
#1114
-
I rearranged the order and location of the statusbar, and I find that there is often no space as a separator.
Here, no space as separator between permissions and owner.
|
Beta Was this translation helpful? Give feedback.
Answered by
lpnh
Jun 23, 2024
Replies: 3 comments 4 replies
-
add |
Beta Was this translation helpful? Give feedback.
3 replies
-
Anyone can help me? |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hi! Try this: function Status:permissions()
local h = cx.active.current.hovered
if not h then
return ui.Line {}
end
local perm = h.cha:permissions()
if not perm then
return ui.Line {}
end
local spans = {}
for i = 1, #perm do
local c = perm:sub(i, i)
local style = THEME.status.permissions_t
if c == "-" then
style = THEME.status.permissions_s
elseif c == "r" then
style = THEME.status.permissions_r
elseif c == "w" then
style = THEME.status.permissions_w
elseif c == "x" or c == "s" or c == "S" or c == "t" or c == "T" then
style = THEME.status.permissions_x
end
spans[i] = ui.Span(c):style(style):fg("black"):bg("red")
end
table.insert(spans, 1, ui.Span(" "):fg("black"):bg("red"))
table.insert(spans, ui.Span(" "):fg("black"):bg("red"))
return ui.Line(spans)
end |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
og900aero
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi! Try this: