Skip to content

Commit

Permalink
add prefixes
Browse files Browse the repository at this point in the history
Signed-off-by: Luterán Lajos <[email protected]>
  • Loading branch information
luteran42 committed Mar 11, 2024
1 parent 8d83618 commit e48a2ae
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 7 deletions.
21 changes: 14 additions & 7 deletions config/theme.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,20 @@ fg = "light_yellow"
bold = true
prefix = "v "

[mark]
cut.fg = "red"
cut.bold = true
copy.fg = "rgb(235, 104, 65)" # orange
copy.bold = true
symlink.fg = "rgb(254, 132, 172)" # pink
symlink.bold = true
[mark.cut]
fg = "red"
bold = true
# prefix = " "

[mark.copy]
fg = "rgb(235, 104, 65)" # orange
bold = true
# prefix = " "

[mark.symlink]
fg = "rgb(254, 132, 172)" # pink
bold = true
# prefix = " "

##########################################
## File List - System File Types
Expand Down
15 changes: 15 additions & 0 deletions src/util/style.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,21 @@ pub fn entry_style(entry: &JoshutoDirEntry) -> Style {
}

pub fn entry_prefix(entry: &JoshutoDirEntry) -> (&str, usize) {
if entry.is_marked_cut() {
if let Some(cut_mark) = THEME_T.mark.get("cut") {
return (cut_mark.prefix.as_str(), cut_mark.prefix_width);
}
}
if entry.is_marked_copy() {
if let Some(copy_mark) = THEME_T.mark.get("copy") {
return (copy_mark.prefix.as_str(), copy_mark.prefix_width);
}
}
if entry.is_marked_sym() {
if let Some(sym_mark) = THEME_T.mark.get("symlink") {
return (sym_mark.prefix.as_str(), sym_mark.prefix_width);
}
}
if entry.is_visual_mode_selected() {
return (
THEME_T.visual_mode_selection.prefix.as_str(),
Expand Down

0 comments on commit e48a2ae

Please sign in to comment.