Skip to content

Commit

Permalink
perf: do not make unnecessary evaluation of has_custom_style
Browse files Browse the repository at this point in the history
  • Loading branch information
nik-rev committed Dec 17, 2024
1 parent 2cd6c90 commit ee8162d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions helix-term/src/ui/prompt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -450,11 +450,10 @@ impl Prompt {
self.completion.iter().enumerate().skip(offset).take(items)
{
let is_selected = Some(i) == self.selection;
let has_custom_style = completion.style != Style::default();

let completion_item_style = if is_selected {
selected_color
} else if has_custom_style {
} else if completion.style != Style::default() {
completion.style
} else {
default_completion_color
Expand Down

0 comments on commit ee8162d

Please sign in to comment.