launcher: rustfmt
This commit is contained in:
+16
-7
@@ -64,7 +64,11 @@ impl Launcher {
|
||||
buf.memset(bg);
|
||||
|
||||
let mut x_off = if self.input.len() > 0 {
|
||||
let c = if self.matches.len() == 0 { Color::new(1.0, 0.5, 0.5, 1.0) } else { Color::new(1.0, 1.0, 1.0, 1.0) };
|
||||
let c = if self.matches.len() == 0 {
|
||||
Color::new(1.0, 0.5, 0.5, 1.0)
|
||||
} else {
|
||||
Color::new(1.0, 1.0, 1.0, 1.0)
|
||||
};
|
||||
let dim = self.font.borrow_mut().auto_draw_text(
|
||||
&mut buf.subdimensions((0, 0, 1232, 32))?,
|
||||
bg,
|
||||
@@ -77,11 +81,9 @@ impl Launcher {
|
||||
0
|
||||
};
|
||||
|
||||
|
||||
let mut width_remaining: i32 = 1232 - x_off as i32;
|
||||
for (idx, m) in self.matches.iter().enumerate() {
|
||||
let mut b =
|
||||
match buf.subdimensions((x_off, 0, width_remaining as u32, 32)) {
|
||||
let mut b = match buf.subdimensions((x_off, 0, width_remaining as u32, 32)) {
|
||||
Ok(b) => b,
|
||||
Err(_) => break,
|
||||
};
|
||||
@@ -207,13 +209,18 @@ impl ModuleImpl for Launcher {
|
||||
Err(_) => self.result = None,
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
Some('!') => (),
|
||||
_ => {
|
||||
let mut m = self
|
||||
.options
|
||||
.iter()
|
||||
.map(|x| (fuzzy_match(&x.to_lowercase(), &self.input.to_lowercase()), x))
|
||||
.map(|x| {
|
||||
(
|
||||
fuzzy_match(&x.to_lowercase(), &self.input.to_lowercase()),
|
||||
x,
|
||||
)
|
||||
})
|
||||
.filter(|(x, _)| x.is_some())
|
||||
.map(|(x, y)| (x.unwrap(), y.to_string()))
|
||||
.collect::<Vec<(i64, String)>>();
|
||||
@@ -261,10 +268,12 @@ impl ModuleImpl for Launcher {
|
||||
println!("{}", self.input.chars().skip(1).collect::<String>());
|
||||
std::process::exit(0);
|
||||
}
|
||||
_ => if self.matches.len() > self.offset {
|
||||
_ => {
|
||||
if self.matches.len() > self.offset {
|
||||
println!("{}", self.matches[self.offset]);
|
||||
std::process::exit(0);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
keysyms::XKB_KEY_Right => {
|
||||
|
||||
Reference in New Issue
Block a user