feat: ownership linemode (#1238)

Co-authored-by: sxyazi <sxyazi@gmail.com>
This commit is contained in:
AidanV 2024-07-02 11:08:54 -04:00 committed by GitHub
parent 3c88edbc4d
commit 11547eefe0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 0 deletions

View File

@ -88,6 +88,7 @@ keymap = [
{ on = [ "m", "s" ], run = "linemode size", desc = "Set linemode to size" },
{ on = [ "m", "p" ], run = "linemode permissions", desc = "Set linemode to permissions" },
{ on = [ "m", "m" ], run = "linemode mtime", desc = "Set linemode to mtime" },
{ on = [ "m", "o" ], run = "linemode owner", desc = "Set linemode to owner" },
{ on = [ "m", "n" ], run = "linemode none", desc = "Set linemode to none" },
# Copy

View File

@ -21,6 +21,9 @@ function Folder:linemode(area, files)
spans[#spans + 1] = ui.Span(time and os.date("%y-%m-%d %H:%M", time // 1) or "")
elseif mode == "permissions" then
spans[#spans + 1] = ui.Span(f.cha:permissions() or "")
elseif mode == "owner" then
spans[#spans + 1] = ya.user_name and ui.Span(ya.user_name(f.cha.uid) .. ":" .. ya.group_name(f.cha.gid))
or ui.Span("")
end
spans[#spans + 1] = ui.Span(" ")