Skip to content

Commit

Permalink
feat: make statusline mode configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
PFiS1737 committed Feb 10, 2025
1 parent d452bf4 commit 0e0268a
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions yazi-config/preset/theme-dark.toml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ separator_right = [ "", "" ]
# Format
format_percent = "%2d%%"
format_position = "%2d/%-2d"
format_mode = "%.3s"

# Progress
progress_label = { bold = true }
Expand Down
1 change: 1 addition & 0 deletions yazi-config/preset/theme-light.toml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ separator_right = [ "", "" ]
# Format
format_percent = "%2d%%"
format_position = "%2d/%-2d"
format_mode = "%.3s"

# Progress
progress_label = { bold = true }
Expand Down
1 change: 1 addition & 0 deletions yazi-config/src/theme/theme.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ struct Status {
// Format
pub format_percent: String,
pub format_position: String,
pub format_mode: String,

// Progress
pub progress_label: Style,
Expand Down
2 changes: 1 addition & 1 deletion yazi-plugin/preset/components/status.lua
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function Status:style()
end

function Status:mode()
local mode = tostring(self._tab.mode):sub(1, 3):upper()
local mode = string.format(THEME.status.format_mode, tostring(self._tab.mode):upper())

local style = self:style()
return ui.Line {
Expand Down

0 comments on commit 0e0268a

Please sign in to comment.