From f43ba87a2b98919fdce3dd19a33e514101704621 Mon Sep 17 00:00:00 2001 From: Arijit Basu Date: Fri, 2 Apr 2021 07:45:00 +0530 Subject: [PATCH] Finish Selected -> Selection renaming --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/app.rs | 2 +- src/config.rs | 4 ++-- src/ui.rs | 18 +++++++++--------- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 90f4ed6..0ac9b20 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1117,7 +1117,7 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "xplr" -version = "0.2.6" +version = "0.2.7" dependencies = [ "criterion", "crossterm", diff --git a/Cargo.toml b/Cargo.toml index 638ec52..2cf18ca 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "xplr" -version = "0.2.6" # Update app.rs +version = "0.2.7" # Update app.rs authors = ["Arijit Basu "] edition = "2018" description = "An experimental, minimal, configurable TUI file explorer, stealing ideas from nnn and fzf." diff --git a/src/app.rs b/src/app.rs index 119200e..79d94d9 100644 --- a/src/app.rs +++ b/src/app.rs @@ -11,7 +11,7 @@ use std::collections::VecDeque; use std::fs; use std::path::PathBuf; -pub const VERSION: &str = "v0.2.6"; // Update Cargo.toml +pub const VERSION: &str = "v0.2.7"; // Update Cargo.toml pub const TEMPLATE_TABLE_ROW: &str = "TEMPLATE_TABLE_ROW"; diff --git a/src/config.rs b/src/config.rs index a8c21ee..c79d142 100644 --- a/src/config.rs +++ b/src/config.rs @@ -158,7 +158,7 @@ pub struct GeneralConfig { pub focused_ui: UIConfig, #[serde(default)] - pub selected_ui: UIConfig, + pub selection_ui: UIConfig, } impl Default for GeneralConfig { @@ -208,7 +208,7 @@ impl Default for GeneralConfig { sub_modifier: bits: 0 - selected_ui: + selection_ui: prefix: " {" suffix: "}" style: diff --git a/src/ui.rs b/src/ui.rs index fa84393..0782194 100644 --- a/src/ui.rs +++ b/src/ui.rs @@ -105,7 +105,7 @@ fn draw_table(f: &mut Frame, rect: Rect, app: &app::App, hb: &Han let ui = if is_focused { &config.general.focused_ui } else if is_selected { - &config.general.selected_ui + &config.general.selection_ui } else { &config.general.normal_ui }; @@ -179,7 +179,7 @@ fn draw_table(f: &mut Frame, rect: Rect, app: &app::App, hb: &Han let style = if is_focused { config.general.focused_ui.style } else if is_selected { - config.general.selected_ui.style + config.general.selection_ui.style } else { config .filetypes @@ -251,27 +251,27 @@ fn draw_table(f: &mut Frame, rect: Rect, app: &app::App, hb: &Han } fn draw_selection(f: &mut Frame, rect: Rect, app: &app::App, _: &Handlebars) { - let selected: Vec = app + let selection: Vec = app .selection() .iter() .map(|n| n.absolute_path.clone()) .map(ListItem::new) .collect(); - let selected_count = selected.len(); + let selection_count = selection.len(); // Selected items - let selected_list = List::new(selected).block( + let selection_list = List::new(selection).block( Block::default() .borders(Borders::ALL) - .title(format!(" Selected ({}) ", selected_count)), + .title(format!(" Selection ({}) ", selection_count)), ); let mut list_state = ListState::default(); - if selected_count > 0 { - list_state.select(Some(selected_count.max(1) - 1)); + if selection_count > 0 { + list_state.select(Some(selection_count.max(1) - 1)); } - f.render_stateful_widget(selected_list, rect, &mut list_state); + f.render_stateful_widget(selection_list, rect, &mut list_state); } fn draw_help_menu(f: &mut Frame, rect: Rect, app: &app::App, _: &Handlebars) {