From fb6de19e81d5ce0b31933556276a2797db204c07 Mon Sep 17 00:00:00 2001 From: Jed Date: Sun, 21 Jun 2026 19:31:34 +0200 Subject: [PATCH] feat: Fix imports --- yazi-core/src/highlighter.rs | 15 ++++++++------- yazi-plugin/src/utils/preview.rs | 5 ++++- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/yazi-core/src/highlighter.rs b/yazi-core/src/highlighter.rs index 90d19a0a..f7883d38 100644 --- a/yazi-core/src/highlighter.rs +++ b/yazi-core/src/highlighter.rs @@ -1,7 +1,5 @@ use anyhow::{Result, anyhow, bail}; -use ratatui::style; -use ratatui::style::Style; -use ratatui::{ +use ratatui_core::{ layout::Size, text::{Line, Span, Text}, }; @@ -19,7 +17,10 @@ use syntect::{ use yazi_binding::elements::HighlightPosition; use yazi_config::{THEME, YAZI}; use yazi_runner::previewer::PeekError; -use yazi_shared::{id::{Id, Ids}, replace_to_printable}; +use yazi_shared::{ + id::{Id, Ids}, + replace_to_printable, +}; use yazi_shim::ratatui::LineIter; static INCR: Ids = Ids::new(); @@ -137,7 +138,7 @@ impl Highlighter { if let Some(pos) = position && pos.line == *i { - static_line.style = Style::new().bg(style::Color::Red); + static_line.style = ratatui_core::style::Style::new().bg(ratatui_core::style::Color::Red); } lines.push(static_line); } @@ -172,7 +173,7 @@ impl Highlighter { if let Some(pos) = position && pos.line == *i { - static_line.style = Style::new().bg(style::Color::Red); + static_line.style = ratatui_core::style::Style::new().bg(ratatui_core::style::Color::Red); } lines.push(static_line); } @@ -264,7 +265,7 @@ impl Highlighter { Span { content: s.into(), - style: ratatui_core::style::Style { + style: ratatui_core::style::Style { fg: Self::to_ansi_color(style.foreground), // bg: Self::to_ansi_color(style.background), add_modifier: modifier, diff --git a/yazi-plugin/src/utils/preview.rs b/yazi-plugin/src/utils/preview.rs index 6709ccc1..619ce5d2 100644 --- a/yazi-plugin/src/utils/preview.rs +++ b/yazi-plugin/src/utils/preview.rs @@ -1,5 +1,8 @@ use mlua::{ExternalError, Function, IntoLuaMulti, Lua, Table, Value}; -use yazi_binding::{Error, elements::Area}; +use yazi_binding::{ + Error, + elements::{Area, HighlightPosition}, +}; use yazi_core::{Highlighter, MgrProxy, tab::PreviewLock}; use yazi_fs::FsUrl; use yazi_runner::previewer::PeekError;