feat: add All field to ruler file (#2376)
This commit is contained in:
1 parent
16b21e48f2
commit
a32371088b
6 files changed
+18
-8
No files matched your search
@@ -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).
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -44,6 +44,7 @@ type rulerData struct {
|
||||
Index int
|
||||
Total int
|
||||
Hidden int
|
||||
All int
|
||||
LinePercentage string
|
||||
ScrollPercentage string
|
||||
Filter []string
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user