Skip to content

Commit

Permalink
feat: ownership linemode (#1238)
Browse files Browse the repository at this point in the history
Co-authored-by: sxyazi <[email protected]>
  • Loading branch information
AidanV and sxyazi authored Jul 2, 2024
1 parent 3c88edb commit 11547ee
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions yazi-config/preset/keymap.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions yazi-plugin/preset/components/folder.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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(" ")
Expand Down

0 comments on commit 11547ee

Please sign in to comment.