diff --git a/CHANGELOG.md b/CHANGELOG.md index e62483ca..c89f5868 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), - Newline characters are now ignored when drawing the ruler with the `ruler` file configured (#2319). - A potential crash when using the `scroll-up`/`scroll-down` commands is now fixed (#2320). - Case-insensitive command-line completions no longer cause user input to be displayed in lowercase (#2336). +- The `ruler` file now supports `.Stat.Extension`, `.Stat.AccessTime`, `.Stat.BirthTime`, `.Stat.ChangeTime` and `.Stat.CustomInfo` (#2329). ## [r40](https://github.com/gokcehan/lf/releases/tag/r40) diff --git a/doc.md b/doc.md index 0e89048f..ff121038 100644 --- a/doc.md +++ b/doc.md @@ -691,7 +691,7 @@ Simulate key pushes given in the argument. ## addcustominfo -Update the `custom` info field of the given file with the given string. +Update the `custom` info and `.Stat.CustomInfo` field of the given file with the given string. The info string may contain ANSI escape codes to further customize its appearance. If no info is provided, clear the file's info instead. @@ -2238,13 +2238,18 @@ The following data fields are exported: .UserOptions map[string]string The value of user-defined options (e.g. `{{.UserOptions.foo}}`) .Stat.Path string Path of the current file .Stat.Name string Name of the current file + .Stat.Extension string Extension of the current file .Stat.Size uint64 Size of the current file .Stat.Permissions string Permissions of the current file .Stat.ModTime string Last modified time of the current file (formatted based on the `timefmt` option) + .Stat.AccessTime string Last access time of the current file (formatted based on the `timefmt` option) + .Stat.BirthTime string Birth time of the current file (formatted based on the `timefmt` option) + .Stat.ChangeTime string Last status (inode) change time of the current file (formatted based on the `timefmt` option) .Stat.LinkCount string Number of hard links for the current file .Stat.User string User of the current file .Stat.Group string Group of the current file .Stat.Target string Target if the current file is a symbolic link, otherwise a blank string + .Stat.CustomInfo string Custom property if defined via `addcustominfo`, otherwise a blank string The following functions are exported: diff --git a/doc.txt b/doc.txt index 234c5344..417a2c09 100644 --- a/doc.txt +++ b/doc.txt @@ -725,9 +725,10 @@ Simulate key pushes given in the argument. addcustominfo -Update the custom info field of the given file with the given string. -The info string may contain ANSI escape codes to further customize its -appearance. If no info is provided, clear the file's info instead. +Update the custom info and .Stat.CustomInfo field of the given file with +the given string. The info string may contain ANSI escape codes to +further customize its appearance. If no info is provided, clear the +file's info instead. calcdirsize @@ -2512,13 +2513,18 @@ The following data fields are exported: .UserOptions map[string]string The value of user-defined options (e.g. `{{.UserOptions.foo}}`) .Stat.Path string Path of the current file .Stat.Name string Name of the current file + .Stat.Extension string Extension of the current file .Stat.Size uint64 Size of the current file .Stat.Permissions string Permissions of the current file .Stat.ModTime string Last modified time of the current file (formatted based on the `timefmt` option) + .Stat.AccessTime string Last access time of the current file (formatted based on the `timefmt` option) + .Stat.BirthTime string Birth time of the current file (formatted based on the `timefmt` option) + .Stat.ChangeTime string Last status (inode) change time of the current file (formatted based on the `timefmt` option) .Stat.LinkCount string Number of hard links for the current file .Stat.User string User of the current file .Stat.Group string Group of the current file .Stat.Target string Target if the current file is a symbolic link, otherwise a blank string + .Stat.CustomInfo string Custom property if defined via `addcustominfo`, otherwise a blank string The following functions are exported: diff --git a/lf.1 b/lf.1 index 6e93293c..bedc4328 100644 --- a/lf.1 +++ b/lf.1 @@ -1,6 +1,6 @@ .\" Automatically generated by Pandoc 3.7.0.2 .\" -.TH "LF" "1" "2025\-12\-31" "r41" "DOCUMENTATION" +.TH "LF" "1" "2026\-01\-11" "r41" "DOCUMENTATION" .SH NAME lf \- terminal file manager .SH SYNOPSIS @@ -688,8 +688,8 @@ Read the configuration file given in the argument. .SS push Simulate key pushes given in the argument. .SS addcustominfo -Update the \f[CR]custom\f[R] info field of the given file with the given -string. +Update the \f[CR]custom\f[R] info and \f[CR].Stat.CustomInfo\f[R] field +of the given file with the given string. The info string may contain ANSI escape codes to further customize its appearance. If no info is provided, clear the file\(aqs info instead. @@ -2548,13 +2548,18 @@ The following data fields are exported: \&.UserOptions map[string]string The value of user\-defined options (e.g. \(ga{{.UserOptions.foo}}\(ga) \&.Stat.Path string Path of the current file \&.Stat.Name string Name of the current file +\&.Stat.Extension string Extension of the current file \&.Stat.Size uint64 Size of the current file \&.Stat.Permissions string Permissions of the current file \&.Stat.ModTime string Last modified time of the current file (formatted based on the \(gatimefmt\(ga option) +\&.Stat.AccessTime string Last access time of the current file (formatted based on the \(gatimefmt\(ga option) +\&.Stat.BirthTime string Birth time of the current file (formatted based on the \(gatimefmt\(ga option) +\&.Stat.ChangeTime string Last status (inode) change time of the current file (formatted based on the \(gatimefmt\(ga option) \&.Stat.LinkCount string Number of hard links for the current file \&.Stat.User string User of the current file \&.Stat.Group string Group of the current file \&.Stat.Target string Target if the current file is a symbolic link, otherwise a blank string +\&.Stat.CustomInfo string Custom property if defined via \(gaaddcustominfo\(ga, otherwise a blank string .EE .PP The following functions are exported: diff --git a/ruler.go b/ruler.go index 69239754..57d86d87 100644 --- a/ruler.go +++ b/ruler.go @@ -16,13 +16,18 @@ var gDefaultRuler string type statData struct { Path string Name string + Extension string Size uint64 Permissions string ModTime string + AccessTime string + BirthTime string + ChangeTime string LinkCount string User string Group string Target string + CustomInfo string } type rulerData struct { diff --git a/ui.go b/ui.go index f7bcca90..6925f8b7 100644 --- a/ui.go +++ b/ui.go @@ -1028,13 +1028,18 @@ func (ui *ui) drawRulerFile(nav *nav) { stat = &statData{ Path: curr.path, Name: curr.Name(), + Extension: curr.ext, Size: uint64(curr.Size()), Permissions: permString(curr.Mode()), ModTime: curr.ModTime().Format(gOpts.timefmt), + AccessTime: curr.accessTime.Format(gOpts.timefmt), + BirthTime: curr.birthTime.Format(gOpts.timefmt), + ChangeTime: curr.changeTime.Format(gOpts.timefmt), LinkCount: linkCount(curr), User: userName(curr), Group: groupName(curr), Target: curr.linkTarget, + CustomInfo: curr.customInfo, } } else { ui.echoerrf("stat: %s", curr.err)