From e48a2ae5a8572728587f62361ff4a4aaa2c454db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luter=C3=A1n=20Lajos?= Date: Mon, 11 Mar 2024 01:28:11 +0100 Subject: [PATCH] add prefixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Luterán Lajos --- config/theme.toml | 21 ++++++++++++++------- src/util/style.rs | 15 +++++++++++++++ 2 files changed, 29 insertions(+), 7 deletions(-) diff --git a/config/theme.toml b/config/theme.toml index 00629bd06..c04f3d2ee 100644 --- a/config/theme.toml +++ b/config/theme.toml @@ -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 diff --git a/src/util/style.rs b/src/util/style.rs index 7a7f8a040..84ab90b97 100644 --- a/src/util/style.rs +++ b/src/util/style.rs @@ -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(),