Update: 2024-11-21

This commit is contained in:
2024-11-21 14:02:29 +02:00
parent 7da57cd023
commit 74e444a83f
1010 changed files with 271 additions and 574412 deletions

View File

@@ -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