Port ansi.tmTheme to yazi-prebuild crate

This commit is contained in:
sxyazi 2023-12-30 01:21:38 +08:00
parent 85c238c619
commit 0500a95430
No known key found for this signature in database
4 changed files with 17 additions and 784 deletions

4
Cargo.lock generated
View file

@ -2736,9 +2736,9 @@ dependencies = [
[[package]]
name = "yazi-prebuild"
version = "0.1.1"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "394457709d77af570fcb3c0ef878336213b4e9c8f298eccde728aecd602aa7e0"
checksum = "f4b6c8e12e39ac0f79fa96f36e5b88e0da8d230691abd729eec709b43c74f632"
[[package]]
name = "yazi-scheduler"

View file

@ -1,762 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>author</key>
<string>Chiel ten Brinke</string>
<key>colorSpaceName</key>
<string>sRGB</string>
<key>comment</key>
<string>Generated from the neo-ansi template at https://github.com/chtenb/neo-ansi. The colors in this theme are encoded as RRGGBBAA where RR is an ANSI palette number from 00 to 0f (the 8 colors and their bright versions), and AA is the special value 00 to indicate this encoding is being used.</string>
<key>name</key>
<string>Neo-ansi Terminal Theme for Bat</string>
<key>semanticClass</key>
<string>theme.neo-ansi</string>
<key>settings</key>
<array>
<dict>
<key>settings</key>
<dict>
<key>background</key>
<string>#00000001</string>
<key>foreground</key>
<string>#00000001</string>
<key>gutter</key>
<string>#00000001</string>
<key>gutterForeground</key>
<string>#00000001</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Invalid</string>
<key>scope</key>
<string>invalid, invalid.illegal</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#09000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Invalid deprecated</string>
<key>scope</key>
<string>invalid.deprecated</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#0b000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>URL</string>
<key>scope</key>
<string>*url*, *link*, *uri*</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string>underline</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Storage operators</string>
<key>scope</key>
<string>storage.modifier.pointer, storage.modifier.reference</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#0c000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Pointer access</string>
<key>scope</key>
<string>punctuation.separator.pointer-access</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#0c000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>CSS Class and Support</string>
<key>scope</key>
<string>source.css support.type.property-name, source.sass support.type.property-name, source.scss support.type.property-name, source.less support.type.property-name, source.stylus support.type.property-name, source.postcss support.type.property-name</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#06000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>CSS Classes</string>
<key>scope</key>
<string>entity.other.attribute-name.pseudo-class, entity.other.attribute-name.pseudo-element</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#0b000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>CSS Variables</string>
<key>scope</key>
<string>source.css variable</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#0f000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>CSS Properties</string>
<key>scope</key>
<string>source.css support.type.property-name</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#07000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>COMMENT</string>
<key>scope</key>
<string>comment, punctuation.definition.comment, string.quoted.docstring</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string>italic</string>
<key>foreground</key>
<string>#00000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>VALUE TYPE, BUILTIN TYPE, TAG</string>
<key>scope</key>
<string>keyword.type, entity.name.tag, meta.tag.sgml, entity.name.type.struct, support.type, support.class, support.type.sys-types, support.type.built-in</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#01000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>STRING, SYMBOL</string>
<key>scope</key>
<string>string, constant.other.symbol</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#02000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>TYPE, ATTRIBUTE</string>
<key>scope</key>
<string>entity.name, entity.other.attribute-name</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#03000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>FUNCTION, METHOD, OPERATOR</string>
<key>scope</key>
<string>entity.name.function, variable.function</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#04000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>KEYWORD, STORAGE</string>
<key>scope</key>
<string>keyword, storage</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string></string>
<key>foreground</key>
<string>#05000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>SUPPORT, SPECIAL, BUILTIN OTHER</string>
<key>scope</key>
<string>support, keyword.other.special-method, variable.language, string.regexp, constant.character.escape, support.other.variable</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#06000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>TEXT</string>
<key>scope</key>
<string>source, text, variable, entity.name.variable, entity.name.namespace, constant.other.placeholder</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#07000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>CONSTANT</string>
<key>scope</key>
<string>constant.numeric, constant.language, support.constant, constant.character, constant.escape, keyword.other.unit</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#09000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>STRING LINK</string>
<key>scope</key>
<string>string.other.link</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#0a000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>ALT TYPE</string>
<key>scope</key>
<string>entity.name.type.parameter, entity.name.type.type-parameter, variable.other.generic-type</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#0b000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>ALT FUNCTION</string>
<key>scope</key>
<string>keyword.operator, support.function</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#0c000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>ALT KEYWORD</string>
<key>scope</key>
<string>keyword.other</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#0d000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>PUNCTUATION</string>
<key>scope</key>
<string>punctuation.definition.tag, punctuation.definition, punctuation, punctuation.definition.tag.html, punctuation.definition.tag.begin.html, punctuation.definition.tag.end.html, punctuation.section.embedded, keyword.other.template, keyword.other.substitution, meta.separator</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#0e000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>ALT VARIABLE</string>
<key>scope</key>
<string>entity.name.variable.field, entity.name.variable.property, variable.other.property, variable.other.field</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#0f000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Inserted</string>
<key>scope</key>
<string>markup.inserted</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#02000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Deleted</string>
<key>scope</key>
<string>markup.deleted</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#01000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Changed</string>
<key>scope</key>
<string>markup.changed</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#03000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>GitGutter deleted</string>
<key>scope</key>
<string>markup.deleted.git_gutter</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#01000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>GitGutter inserted</string>
<key>scope</key>
<string>markup.inserted.git_gutter</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#02000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>GitGutter changed</string>
<key>scope</key>
<string>markup.changed.git_gutter</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#03000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>GitGutter untracked</string>
<key>scope</key>
<string>markup.untracked.git_gutter</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#09000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>GitGutter ignored</string>
<key>scope</key>
<string>markup.ignored.git_gutter</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#08000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Values</string>
<key>scope</key>
<string>constant.other.haskell</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#01000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Types</string>
<key>scope</key>
<string>storage.type.haskell</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string></string>
<key>foreground</key>
<string>#03000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Storage</string>
<key>scope</key>
<string>source.js storage, source.js keyword.declaration</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#03000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>String, Symbols</string>
<key>scope</key>
<string>constant.other.key meta.group.braces.curly constant.other.object.key.js string.unquoted.label.js</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string></string>
<key>foreground</key>
<string>#02000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>JS import</string>
<key>scope</key>
<string>entity.name.module.js, variable.import.parameter.js, variable.other.class.js</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#06000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Decorators</string>
<key>scope</key>
<string>tag.decorator.js entity.name.tag.js, tag.decorator.js punctuation.definition.tag.js</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string>italic</string>
<key>foreground</key>
<string>#06000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>JSON Key - Level 0</string>
<key>scope</key>
<string>source.json meta.structure.dictionary.json support.type.property-name.json</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#01000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>JSON Key - Level 1</string>
<key>scope</key>
<string>source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json support.type.property-name.json</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#03000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>JSON Key - Level 2</string>
<key>scope</key>
<string>source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json support.type.property-name.json</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#0b000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>JSON Key - Level 3</string>
<key>scope</key>
<string>source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json support.type.property-name.json</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#02000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>JSON Key - Level 4</string>
<key>scope</key>
<string>source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json support.type.property-name.json</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#04000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>JSON Key - Level 5</string>
<key>scope</key>
<string>source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json support.type.property-name.json</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#06000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>JSON Key - Level 6</string>
<key>scope</key>
<string>source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json support.type.property-name.json</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#05000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>JSON Key - Level 7</string>
<key>scope</key>
<string>source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json support.type.property-name.json</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#07000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>JSON Key - Level 8</string>
<key>scope</key>
<string>source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json support.type.property-name.json</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#0f000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Markup - Bold</string>
<key>scope</key>
<string>markup.bold, markup.bold string</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string></string>
<key>foreground</key>
<string>#01000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Markup - Italic</string>
<key>scope</key>
<string>markup.italic</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string>italic</string>
<key>foreground</key>
<string>#05000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Markup - Underline and Link</string>
<key>scope</key>
<string>markup.underline</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string>underline</string>
<key>foreground</key>
<string>#02000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Markup - Strike</string>
<key>scope</key>
<string>markup.strike</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string>strike</string>
<key>foreground</key>
<string>#08000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Markup - Bold-Italic</string>
<key>scope</key>
<string>markup.bold markup.italic, markup.italic markup.bold, markup.quote markup.bold, markup.bold markup.italic string, markup.italic markup.bold string, markup.quote markup.bold string</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string></string>
<key>foreground</key>
<string>#09000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Markdown - Heading</string>
<key>scope</key>
<string>markdown.heading, markup.heading, markup.heading entity.name, markup.heading.markdown punctuation.definition.heading.markdown, markup.heading.setext</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string></string>
<key>foreground</key>
<string>#01000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Markdown - Link Anchor and Title</string>
<key>scope</key>
<string>constant.other.reference.link.markdown, string.other.link.title.markdown</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#03000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Markup - Raw &amp; Fenced Block</string>
<key>scope</key>
<string>markup.raw, markup.fenced_code, markup.inline.raw</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#04000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Markdown - Link Description</string>
<key>scope</key>
<string>string.other.link.description.title.markdown</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#05000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Markup - Table</string>
<key>scope</key>
<string>markup.table</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#06000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Markup - Quote</string>
<key>scope</key>
<string>markup.quote</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string>italic</string>
<key>foreground</key>
<string>#06000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Markdown - Plain</string>
<key>scope</key>
<string>text.html.markdown, punctuation.definition.list_item.markdown</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#07000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Markdown - Fenced Bode Block Variable</string>
<key>scope</key>
<string>variable.language.fenced.markdown</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#0f000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Types</string>
<key>scope</key>
<string>source.purescript entity.name.type</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#03000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Classes</string>
<key>scope</key>
<string>source.purescript entity.name.class</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#0b000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>String types</string>
<key>scope</key>
<string>storage.type.string.python</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#0e000000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Lifetime types</string>
<key>scope</key>
<string>source.rust entity.name.type.lifetime, source.rust punctuation.definition.lifetime</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#0b000000</string>
</dict>
</dict>
</array>
<key>uuid</key>
<string>uuid</string>
</dict>
</plist>

View file

@ -30,4 +30,4 @@ tokio = { version = "^1", features = [ "parking_lot", "rt-multi-thread"
tokio-util = "^0"
tracing = { version = "^0", features = [ "max_level_debug", "release_max_level_warn" ] }
unicode-width = "^0"
yazi-prebuild = "^0"
yazi-prebuild = "0.1.2"

View file

@ -1,8 +1,8 @@
use std::{mem, path::{Path, PathBuf}, sync::{atomic::{AtomicUsize, Ordering}, OnceLock}};
use std::{io::Cursor, mem, path::{Path, PathBuf}, sync::{atomic::{AtomicUsize, Ordering}, OnceLock}};
use anyhow::{anyhow, Result};
use ratatui::text::{Line, Span, Text};
use syntect::{dumps::from_uncompressed_data, easy::HighlightLines, highlighting::{self, Theme, ThemeSet}, parsing::{SyntaxReference, SyntaxSet}};
use syntect::{dumps, easy::HighlightLines, highlighting::{self, Theme, ThemeSet}, parsing::{SyntaxReference, SyntaxSet}};
use tokio::{fs::File, io::{AsyncBufReadExt, BufReader}};
use yazi_config::{PREVIEW, THEME};
use yazi_shared::PeekError;
@ -26,18 +26,14 @@ impl Highlighter {
Ok(ThemeSet::load_from_reader(&mut std::io::BufReader::new(file))?)
}
#[inline]
fn load_default_theme() -> Theme {
let default_theme = include_str!("../../../yazi-config/preset/ansi.tmTheme");
let mut theme_cursor = std::io::Cursor::new(default_theme.as_bytes());
let theme = SYNTECT_THEME.get_or_init(|| {
from_file().unwrap_or_else(|_| {
ThemeSet::load_from_reader(&mut Cursor::new(yazi_prebuild::ansi_theme())).unwrap()
})
});
ThemeSet::load_from_reader(&mut theme_cursor).expect("Failed to load default ANSI theme")
}
let theme =
SYNTECT_THEME.get_or_init(|| from_file().unwrap_or_else(|_err| load_default_theme()));
let syntaxes =
SYNTECT_SYNTAX.get_or_init(|| from_uncompressed_data(yazi_prebuild::syntaxes()).unwrap());
let syntaxes = SYNTECT_SYNTAX
.get_or_init(|| dumps::from_uncompressed_data(yazi_prebuild::syntaxes()).unwrap());
(theme, syntaxes)
}
@ -139,7 +135,7 @@ impl Highlighter {
}
impl Highlighter {
// https://github.com/sharkdp/bat/blob/master/src/terminal.rs
// Copy from https://github.com/sharkdp/bat/blob/master/src/terminal.rs
fn to_ansi_color(color: highlighting::Color) -> Option<ratatui::style::Color> {
if color.a == 0 {
// Themes can specify one of the user-configurable terminal colors by
@ -198,11 +194,10 @@ impl Highlighter {
Span {
content: s.replace('\t', &indent).into(),
style: ratatui::style::Style {
fg: Self::to_ansi_color(style.foreground),
bg: Self::to_ansi_color(style.background),
underline_color: Default::default(),
add_modifier: modifier,
sub_modifier: Default::default(),
fg: Self::to_ansi_color(style.foreground),
// bg: Self::to_ansi_color(style.background),
add_modifier: modifier,
..Default::default()
},
}
})