Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't sound like a bug fix, should this be in the Added section of the changelog?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Obviously! I did not even notice!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in #2346


## [r40](https://github.com/gokcehan/lf/releases/tag/r40)

Expand Down
7 changes: 6 additions & 1 deletion doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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:

Expand Down
12 changes: 9 additions & 3 deletions doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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:

Expand Down
11 changes: 8 additions & 3 deletions lf.1
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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:
Expand Down
5 changes: 5 additions & 0 deletions ruler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
5 changes: 5 additions & 0 deletions ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down