summaryrefslogtreecommitdiffstats
path: root/src/display
diff options
context:
space:
mode:
authorCanop <cano.petrole@gmail.com>2021-04-30 19:10:50 +0200
committerCanop <cano.petrole@gmail.com>2021-04-30 19:10:50 +0200
commit99b7fb72f15b11d49e0ead4f7b12eda59ea78f1b (patch)
tree226077af3a74bed119793132515794579bf2cdad /src/display
parent0025ac27cc25c43d2bf2c086ced09a5dca5cfde1 (diff)
fix shifted match highlighting on regex patterns when showing icons
Fix #376
Diffstat (limited to 'src/display')
-rw-r--r--src/display/displayable_tree.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/display/displayable_tree.rs b/src/display/displayable_tree.rs
index 4e76f4b..0af677c 100644
--- a/src/display/displayable_tree.rs
+++ b/src/display/displayable_tree.rs
@@ -280,12 +280,21 @@ impl<'a, 's, 't> DisplayableTree<'a, 's, 't> {
selected: bool,
) -> Result<usize, ProgramError> {
cond_bg!(char_match_style, self, selected, self.skin.char_match);
+ if let Some(icon) = line.icon {
+ cw.queue_char(style, icon)?;
+ cw.queue_char(style, ' ')?;
+ cw.queue_char(style, ' ')?;
+ }
let label = if pattern_object.subpath {
&line.subpath
} else {
&line.name
};
let name_match = self.tree.options.pattern.pattern.search_string(label);
+ if selected {
+ debug!("label: {:?}", label);
+ debug!("name_match: {:#?}", &name_match);
+ }
let matched_string = MatchedString::new(
name_match,
label,