Skip to content

Commit e0e8cec

Browse files
committed
feat: Add show_panel_footer_info flag
1 parent f291156 commit e0e8cec

File tree

5 files changed

+21
-5
lines changed

5 files changed

+21
-5
lines changed

dfsdf

Whitespace-only changes.

src/internal/common/config_type.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ type ConfigType struct {
7171
CdOnQuit bool `toml:"cd_on_quit" comment:"\nCd on quit (For more details, please check out https://superfile.netlify.app/configure/superfile-config/#cd_on_quit)"`
7272
DefaultOpenFilePreview bool `toml:"default_open_file_preview" comment:"\nWhether to open file preview automatically every time superfile is opened."`
7373
ShowImagePreview bool `toml:"show_image_preview" comment:"\nWhether to show image preview."`
74+
ShowPanelFooterInfo bool `toml:"show_panel_footer_info" comment:"\nWhether to show additional footer info for file panel."`
7475
DefaultDirectory string `toml:"default_directory" comment:"\nThe path of the first file panel when superfile is opened."`
7576
FileSizeUseSI bool `toml:"file_size_use_si" comment:"\nDisplay file sizes using powers of 1000 (kB, MB, GB) instead of powers of 1024 (KiB, MiB, GiB)."`
7677
DefaultSortType int `toml:"default_sort_type" comment:"\nDefault sort type (0: Name, 1: Size, 2: Date Modified)."`

src/internal/model_render.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,14 @@ func (panel *filePanel) Render(mainPanelHeight int, filePanelWidth int, focussed
122122
}
123123
cursorNumberString := fmt.Sprintf("%d/%d", cursorNumber, len(panel.element))
124124

125-
r.SetBorderInfoItems(sortTypeString, panelModeString, cursorNumberString)
126-
if r.AreInfoItemsTruncated() {
127-
// Use smaller values
128-
r.SetBorderInfoItems(sortTypeStringSmall, panelModeStringSmall, cursorNumberString)
125+
if common.Config.ShowPanelFooterInfo {
126+
r.SetBorderInfoItems(sortTypeString, panelModeString, cursorNumberString)
127+
if r.AreInfoItemsTruncated() {
128+
// Use smaller values
129+
r.SetBorderInfoItems(sortTypeStringSmall, panelModeStringSmall, cursorNumberString)
130+
}
131+
} else {
132+
r.SetBorderInfoItems(cursorNumberString)
129133
}
130134

131135
if len(panel.element) == 0 {

src/superfile_config/config.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ default_open_file_preview = true
2121
# Whether to show image preview
2222
show_image_preview = true
2323
#
24+
#
25+
# Whether to hide additional footer info for file panel.
26+
show_panel_footer_info = true
27+
#
2428
# The path of the first file panel when superfile is opened.
2529
default_directory = "."
2630
#

website/src/content/docs/configure/superfile-config.mdx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,14 @@ Example command to enable - `Set-ExecutionPolicy -ExecutionPolicy RemoteSigned`
9999

100100
`true` => Shows the image preview in file preview panel when an image file is selected.
101101

102-
`false` => Does not shows the image preview.
102+
`false` => Does not show the image preview.
103+
104+
- ###### show_panel_footer_info
105+
106+
`true` => Shows additional footer info for file panel like panel mode and sort type.
107+
108+
`false` => Does not show additional footer info for file panel
109+
103110

104111
- ###### file_size_use_si
105112

0 commit comments

Comments
 (0)