diff --git a/CHANGELOG.md b/CHANGELOG.md index 03eaaf2e..5b781d9b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), ## Unreleased +### Added + +- A new field `.All` is added to the `ruler` file to display the number of all files (i.e. visible + hidden) in the current working directory (#2376). + ### Fixed - Previews are now cleaned when changing to an empty directory (#2369). diff --git a/doc.md b/doc.md index d667238f..1be783b6 100644 --- a/doc.md +++ b/doc.md @@ -2226,8 +2226,9 @@ The following data fields are exported: .Select []string Selection list .Visual []string Visual selection .Index int Index of the cursor - .Total int Number of visible files in the current directory - .Hidden int Number of hidden files in the current directory + .Total int Number of visible files in the current working directory + .Hidden int Number of hidden files in the current working directory + .All int Number of all files in the current working directory .LinePercentage string Line percentage (analogous to `%p` for the `statusline` option in Vim) .ScrollPercentage string Scroll percentage (analogous to `%P` for the `statusline` option in Vim) .Filter []string Filter currently being applied diff --git a/doc.txt b/doc.txt index 3f904218..939d0198 100644 --- a/doc.txt +++ b/doc.txt @@ -2500,8 +2500,9 @@ The following data fields are exported: .Select []string Selection list .Visual []string Visual selection .Index int Index of the cursor - .Total int Number of visible files in the current directory - .Hidden int Number of hidden files in the current directory + .Total int Number of visible files in the current working directory + .Hidden int Number of hidden files in the current working directory + .All int Number of all files in the current working directory .LinePercentage string Line percentage (analogous to `%p` for the `statusline` option in Vim) .ScrollPercentage string Scroll percentage (analogous to `%P` for the `statusline` option in Vim) .Filter []string Filter currently being applied diff --git a/lf.1 b/lf.1 index dbbdc813..3160086f 100644 --- a/lf.1 +++ b/lf.1 @@ -1,6 +1,6 @@ .\" Automatically generated by Pandoc 3.7.0.2 .\" -.TH "LF" "1" "2026\-02\-04" "r41" "DOCUMENTATION" +.TH "LF" "1" "2026\-02\-08" "r42" "DOCUMENTATION" .SH NAME lf \- terminal file manager .SH SYNOPSIS @@ -2536,8 +2536,9 @@ The following data fields are exported: \&.Select []string Selection list \&.Visual []string Visual selection \&.Index int Index of the cursor -\&.Total int Number of visible files in the current directory -\&.Hidden int Number of hidden files in the current directory +\&.Total int Number of visible files in the current working directory +\&.Hidden int Number of hidden files in the current working directory +\&.All int Number of all files in the current working directory \&.LinePercentage string Line percentage (analogous to \(ga%p\(ga for the \(gastatusline\(ga option in Vim) \&.ScrollPercentage string Scroll percentage (analogous to \(ga%P\(ga for the \(gastatusline\(ga option in Vim) \&.Filter []string Filter currently being applied diff --git a/ruler.go b/ruler.go index 930a1473..cec5215b 100644 --- a/ruler.go +++ b/ruler.go @@ -44,6 +44,7 @@ type rulerData struct { Index int Total int Hidden int + All int LinePercentage string ScrollPercentage string Filter []string diff --git a/ui.go b/ui.go index ef087bbd..86bb1250 100644 --- a/ui.go +++ b/ui.go @@ -1031,7 +1031,8 @@ func (ui *ui) drawRulerFile(nav *nav) { dir := nav.currDir() tot := len(dir.files) ind := min(dir.ind+1, tot) - hid := len(dir.allFiles) - tot + all := len(dir.allFiles) + hid := all - tot var linePercentage string if tot == 0 { @@ -1112,6 +1113,7 @@ func (ui *ui) drawRulerFile(nav *nav) { Index: ind, Total: tot, Hidden: hid, + All: all, LinePercentage: linePercentage, ScrollPercentage: scrollPercentage, Filter: dir.filter,