refactor: pass the Style instead of Theme

This commit is contained in:
Nik Revenco 2025-03-25 21:34:06 +00:00
parent c101f37298
commit b3b1c88d27
2 changed files with 5 additions and 5 deletions

View file

@ -254,6 +254,7 @@ impl EditorView {
decorations: &mut DecorationManager, decorations: &mut DecorationManager,
theme: &Theme, theme: &Theme,
) { ) {
const INLINE_BLAME_SCOPE: &str = "ui.virtual.inline-blame";
match inline_blame.behaviour { match inline_blame.behaviour {
InlineBlameBehaviour::Hidden => (), InlineBlameBehaviour::Hidden => (),
InlineBlameBehaviour::CursorLine => { InlineBlameBehaviour::CursorLine => {
@ -265,7 +266,7 @@ impl EditorView {
doc.line_blame(cursor_line_idx as u32, &inline_blame.format) doc.line_blame(cursor_line_idx as u32, &inline_blame.format)
{ {
decorations.add_decoration(InlineBlame::new( decorations.add_decoration(InlineBlame::new(
theme, theme.get(INLINE_BLAME_SCOPE),
text_decorations::blame::LineBlame::OneLine(( text_decorations::blame::LineBlame::OneLine((
cursor_line_idx, cursor_line_idx,
line_blame, line_blame,
@ -306,7 +307,7 @@ impl EditorView {
} }
decorations.add_decoration(InlineBlame::new( decorations.add_decoration(InlineBlame::new(
theme, theme.get(INLINE_BLAME_SCOPE),
text_decorations::blame::LineBlame::ManyLines(blame_lines), text_decorations::blame::LineBlame::ManyLines(blame_lines),
)); ));
} }

View file

@ -1,7 +1,6 @@
use helix_core::Position; use helix_core::Position;
use helix_view::theme::Style; use helix_view::theme::Style;
use helix_view::Theme;
use crate::ui::document::{LinePos, TextRenderer}; use crate::ui::document::{LinePos, TextRenderer};
use crate::ui::text_decorations::Decoration; use crate::ui::text_decorations::Decoration;
@ -20,9 +19,9 @@ pub struct InlineBlame {
} }
impl InlineBlame { impl InlineBlame {
pub fn new(theme: &Theme, lines: LineBlame) -> Self { pub fn new(style: Style, lines: LineBlame) -> Self {
InlineBlame { InlineBlame {
style: theme.get("ui.virtual.inline-blame"), style,
lines, lines,
} }
} }