mirror of
https://github.com/kristoferssolo/solorice.git
synced 2026-02-04 06:32:03 +00:00
Update: 2024-11-21
This commit is contained in:
@@ -245,6 +245,18 @@ function Yatline.string.get:hovered_mime()
|
||||
end
|
||||
end
|
||||
|
||||
--- Gets the hovered file's user and group ownership of the current active tab.
|
||||
--- @return string ownership active tab's hovered file's path.
|
||||
function Yatline.string.get:hovered_ownership()
|
||||
local hovered = cx.active.current.hovered
|
||||
|
||||
if hovered then
|
||||
return ya.user_name(hovered.cha.uid) .. ":" .. ya.group_name(hovered.cha.gid)
|
||||
else
|
||||
return ""
|
||||
end
|
||||
end
|
||||
|
||||
--- Gets the hovered file's extension of the current active tab.
|
||||
--- @param show_icon boolean Whether or not an icon will be shown.
|
||||
--- @return string file_extension Current active tab's hovered file's extension.
|
||||
@@ -512,29 +524,33 @@ function Yatline.coloreds.get:permissions()
|
||||
if hovered then
|
||||
local perm = hovered.cha:permissions()
|
||||
|
||||
local coloreds = {}
|
||||
coloreds[1] = { " ", "black" }
|
||||
if perm then
|
||||
local coloreds = {}
|
||||
coloreds[1] = { " ", "black" }
|
||||
|
||||
for i = 1, #perm do
|
||||
local c = perm:sub(i, i)
|
||||
for i = 1, #perm do
|
||||
local c = perm:sub(i, i)
|
||||
|
||||
local fg = permissions_t_fg
|
||||
if c == "-" then
|
||||
fg = permissions_s_fg
|
||||
elseif c == "r" then
|
||||
fg = permissions_r_fg
|
||||
elseif c == "w" then
|
||||
fg = permissions_w_fg
|
||||
elseif c == "x" or c == "s" or c == "S" or c == "t" or c == "T" then
|
||||
fg = permissions_x_fg
|
||||
local fg = permissions_t_fg
|
||||
if c == "-" then
|
||||
fg = permissions_s_fg
|
||||
elseif c == "r" then
|
||||
fg = permissions_r_fg
|
||||
elseif c == "w" then
|
||||
fg = permissions_w_fg
|
||||
elseif c == "x" or c == "s" or c == "S" or c == "t" or c == "T" then
|
||||
fg = permissions_x_fg
|
||||
end
|
||||
|
||||
coloreds[i + 1] = { c, fg }
|
||||
end
|
||||
|
||||
coloreds[i + 1] = { c, fg }
|
||||
coloreds[#perm + 2] = { " ", "black" }
|
||||
|
||||
return coloreds
|
||||
else
|
||||
return ""
|
||||
end
|
||||
|
||||
coloreds[#perm + 2] = { " ", "black" }
|
||||
|
||||
return coloreds
|
||||
else
|
||||
return ""
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user