Skip to content

Commit

Permalink
refactor: use .patch method
Browse files Browse the repository at this point in the history
  • Loading branch information
nik-rev committed Dec 17, 2024
1 parent 0f254ee commit cefa10d
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions helix-term/src/ui/prompt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use helix_core::syntax;
use helix_view::document::Mode;
use helix_view::input::KeyEvent;
use helix_view::keyboard::KeyCode;
use helix_view::theme::Style;
use std::sync::Arc;
use std::{borrow::Cow, ops::RangeFrom};
use tui::buffer::Buffer as Surface;
Expand Down Expand Up @@ -401,7 +400,7 @@ impl Prompt {
pub fn render_prompt(&self, area: Rect, surface: &mut Surface, cx: &mut Context) {
let theme = &cx.editor.theme;
let prompt_color = theme.get("ui.text");
let default_completion_color = theme.get("ui.menu");
let completion_color = theme.get("ui.menu");
let selected_color = theme.get("ui.menu.selected");
let suggestion_color = theme.get("ui.text.inactive");
let background = theme.get("ui.background");
Expand Down Expand Up @@ -453,10 +452,8 @@ impl Prompt {

let completion_item_style = if is_selected {
selected_color
} else if completion.style != Style::default() {
completion.style
} else {
default_completion_color
completion_color.patch(completion.style)
};

surface.set_stringn(
Expand Down

0 comments on commit cefa10d

Please sign in to comment.