summaryrefslogtreecommitdiffstats
path: root/src/tree
diff options
context:
space:
mode:
authorCanop <cano.petrole@gmail.com>2022-09-22 23:32:35 +0200
committerCanop <cano.petrole@gmail.com>2022-09-22 23:34:56 +0200
commit0f5193f31eeeb9f6e721806fca8f3acde6b52da9 (patch)
tree3c8e433ba74864c220c7fa60fd2abe1f47114005 /src/tree
parentb92b296030083e801cb54de56cfeb345ea1383ca (diff)
allow showing only file name on path searches
Using show_matching_characters_on_path_searches: false Fix #490
Diffstat (limited to 'src/tree')
-rw-r--r--src/tree/tree_options.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/tree/tree_options.rs b/src/tree/tree_options.rs
index 7548e50..5cd8584 100644
--- a/src/tree/tree_options.rs
+++ b/src/tree/tree_options.rs
@@ -31,6 +31,7 @@ pub struct TreeOptions {
pub date_time_format: &'static str,
pub sort: Sort,
pub cols_order: Cols, // order of columns
+ pub show_matching_characters_on_path_searches: bool,
}
impl TreeOptions {
@@ -54,6 +55,7 @@ impl TreeOptions {
date_time_format: self.date_time_format,
sort: self.sort,
cols_order: self.cols_order,
+ show_matching_characters_on_path_searches: self.show_matching_characters_on_path_searches,
}
}
/// counts must be computed, either for sorting or just for display
@@ -86,12 +88,15 @@ impl TreeOptions {
})?;
self.apply_launch_args(&conf_matches);
}
- if let Some(b) = &config.show_selection_mark {
- self.show_selection_mark = *b;
+ if let Some(b) = config.show_selection_mark {
+ self.show_selection_mark = b;
}
if let Some(format) = &config.date_time_format {
self.set_date_time_format(format.clone());
}
+ if let Some(b) = config.show_matching_characters_on_path_searches {
+ self.show_matching_characters_on_path_searches = b;
+ }
self.cols_order = config
.cols_order
.as_ref()
@@ -195,6 +200,7 @@ impl Default for TreeOptions {
date_time_format: "%Y/%m/%d %R",
sort: Sort::None,
cols_order: DEFAULT_COLS,
+ show_matching_characters_on_path_searches: true,
}
}
}