aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/ui
diff options
context:
space:
mode:
authorBlaž Hrastnik2021-01-08 07:31:19 +0000
committerBlaž Hrastnik2021-01-08 07:37:36 +0000
commit777a80917db01e658139da11a20ff08256667cfe (patch)
treebe813dfd5f59a6f4c4db937c12769927d8d42c13 /helix-term/src/ui
parent7d41550a23fc3506a37016d5bc362144fb00c080 (diff)
Address clippy lints.
Diffstat (limited to 'helix-term/src/ui')
-rw-r--r--helix-term/src/ui/editor.rs6
-rw-r--r--helix-term/src/ui/picker.rs9
-rw-r--r--helix-term/src/ui/prompt.rs2
3 files changed, 8 insertions, 9 deletions
diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs
index 629cb85c..fced9acb 100644
--- a/helix-term/src/ui/editor.rs
+++ b/helix-term/src/ui/editor.rs
@@ -170,9 +170,11 @@ impl EditorView {
// ugh, improve with a traverse method
// or interleave highlight spans with selection and diagnostic spans
- let style = if view.doc.diagnostics.iter().any(|diagnostic| {
+ let is_diagnostic = view.doc.diagnostics.iter().any(|diagnostic| {
diagnostic.range.0 <= char_index && diagnostic.range.1 > char_index
- }) {
+ });
+
+ let style = if is_diagnostic {
style.clone().add_modifier(Modifier::UNDERLINED)
} else {
style
diff --git a/helix-term/src/ui/picker.rs b/helix-term/src/ui/picker.rs
index a46886ee..60828b6f 100644
--- a/helix-term/src/ui/picker.rs
+++ b/helix-term/src/ui/picker.rs
@@ -170,12 +170,9 @@ impl<T> Component for Picker<T> {
return close_fn;
}
_ => {
- match self.prompt.handle_event(event, cx) {
- EventResult::Consumed(_) => {
- // TODO: recalculate only if pattern changed
- self.score();
- }
- _ => (),
+ if let EventResult::Consumed(_) = self.prompt.handle_event(event, cx) {
+ // TODO: recalculate only if pattern changed
+ self.score();
}
}
}
diff --git a/helix-term/src/ui/prompt.rs b/helix-term/src/ui/prompt.rs
index 7abc08c2..5a47bf12 100644
--- a/helix-term/src/ui/prompt.rs
+++ b/helix-term/src/ui/prompt.rs
@@ -126,7 +126,7 @@ impl Prompt {
let color = if self.completion_selection_index.is_some()
&& i == self.completion_selection_index.unwrap()
{
- Style::default().bg(Color::Rgb(104, 060, 232))
+ Style::default().bg(Color::Rgb(104, 60, 232))
} else {
text_color
};