Skip to content

Commit b3b1c88

Browse files
committed
refactor: pass the Style instead of Theme
1 parent c101f37 commit b3b1c88

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

helix-term/src/ui/editor.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,7 @@ impl EditorView {
254254
decorations: &mut DecorationManager,
255255
theme: &Theme,
256256
) {
257+
const INLINE_BLAME_SCOPE: &str = "ui.virtual.inline-blame";
257258
match inline_blame.behaviour {
258259
InlineBlameBehaviour::Hidden => (),
259260
InlineBlameBehaviour::CursorLine => {
@@ -265,7 +266,7 @@ impl EditorView {
265266
doc.line_blame(cursor_line_idx as u32, &inline_blame.format)
266267
{
267268
decorations.add_decoration(InlineBlame::new(
268-
theme,
269+
theme.get(INLINE_BLAME_SCOPE),
269270
text_decorations::blame::LineBlame::OneLine((
270271
cursor_line_idx,
271272
line_blame,
@@ -306,7 +307,7 @@ impl EditorView {
306307
}
307308

308309
decorations.add_decoration(InlineBlame::new(
309-
theme,
310+
theme.get(INLINE_BLAME_SCOPE),
310311
text_decorations::blame::LineBlame::ManyLines(blame_lines),
311312
));
312313
}

helix-term/src/ui/text_decorations/blame.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use helix_core::Position;
22

33
use helix_view::theme::Style;
4-
use helix_view::Theme;
54

65
use crate::ui::document::{LinePos, TextRenderer};
76
use crate::ui::text_decorations::Decoration;
@@ -20,9 +19,9 @@ pub struct InlineBlame {
2019
}
2120

2221
impl InlineBlame {
23-
pub fn new(theme: &Theme, lines: LineBlame) -> Self {
22+
pub fn new(style: Style, lines: LineBlame) -> Self {
2423
InlineBlame {
25-
style: theme.get("ui.virtual.inline-blame"),
24+
style,
2625
lines,
2726
}
2827
}

0 commit comments

Comments
 (0)