pub struct EditorState {Show 25 fields
pub buffer: Buffer,
pub highlighter: HighlightEngine,
pub indent_calculator: RefCell<IndentCalculator>,
pub overlays: OverlayManager,
pub marker_list: MarkerList,
pub virtual_texts: VirtualTextManager,
pub conceals: ConcealManager,
pub soft_breaks: SoftBreakManager,
pub popups: PopupManager,
pub margins: MarginManager,
pub primary_cursor_line_number: LineNumber,
pub mode: String,
pub text_properties: TextPropertyManager,
pub show_cursors: bool,
pub editing_disabled: bool,
pub buffer_settings: BufferSettings,
pub reference_highlighter: ReferenceHighlighter,
pub is_composite_buffer: bool,
pub debug_highlight_mode: bool,
pub reference_highlight_overlay: ReferenceHighlightOverlay,
pub bracket_highlight_overlay: BracketHighlightOverlay,
pub semantic_tokens: Option<SemanticTokenStore>,
pub folding_ranges: Vec<FoldingRange>,
pub language: String,
pub display_name: String,
}Expand description
The complete editor state - everything needed to represent the current editing session
NOTE: Viewport is NOT stored here - it lives in SplitViewState. This is because viewport is view-specific (each split can view the same buffer at different scroll positions), while EditorState represents the buffer content.
Fields§
§buffer: BufferThe text buffer
highlighter: HighlightEngineSyntax highlighter (tree-sitter or TextMate based on language)
indent_calculator: RefCell<IndentCalculator>Auto-indent calculator for smart indentation (RefCell for interior mutability)
overlays: OverlayManagerOverlays for visual decorations (underlines, highlights, etc.)
marker_list: MarkerListMarker list for content-anchored overlay positions
virtual_texts: VirtualTextManagerVirtual text manager for inline hints (type hints, parameter hints, etc.)
conceals: ConcealManagerConceal ranges for hiding/replacing byte ranges during rendering
soft_breaks: SoftBreakManagerSoft break points for marker-based line wrapping during rendering
popups: PopupManagerPopups for floating windows (completion, documentation, etc.)
margins: MarginManagerMargins for line numbers, annotations, gutter symbols, etc.)
primary_cursor_line_number: LineNumberCached line number for primary cursor (0-indexed) Maintained incrementally to avoid O(n) scanning on every render
mode: StringCurrent mode (for modal editing, if implemented)
text_properties: TextPropertyManagerText properties for virtual buffers (embedded metadata in text ranges) Used by virtual buffers to store location info, severity, etc.
show_cursors: boolWhether to show cursors in this buffer (default true) Can be set to false for virtual buffers like diagnostics panels
editing_disabled: boolWhether editing is disabled for this buffer (default false) When true, typing, deletion, cut/paste, undo/redo are blocked but navigation, selection, and copy are still allowed
buffer_settings: BufferSettingsPer-buffer user settings (tab size, indentation style, etc.) These settings are preserved across file reloads (auto-revert)
reference_highlighter: ReferenceHighlighterSemantic highlighter for word occurrence highlighting
is_composite_buffer: boolWhether this buffer is a composite view (e.g., side-by-side diff)
debug_highlight_mode: boolDebug mode: reveal highlight/overlay spans (WordPerfect-style)
reference_highlight_overlay: ReferenceHighlightOverlayDebounced semantic highlight cache
bracket_highlight_overlay: BracketHighlightOverlayBracket matching highlight overlay
semantic_tokens: Option<SemanticTokenStore>Cached LSP semantic tokens (converted to buffer byte ranges)
folding_ranges: Vec<FoldingRange>Last-known LSP folding ranges for this buffer
language: StringThe detected language ID for this buffer (e.g., “rust”, “csharp”, “text”). Used for LSP config lookup and internal identification.
display_name: StringHuman-readable language display name (e.g., “Rust”, “C#”, “Plain Text”). Shown in the status bar and Set Language prompt.
Implementations§
Source§impl EditorState
impl EditorState
Sourcepub fn apply_language(&mut self, detected: DetectedLanguage)
pub fn apply_language(&mut self, detected: DetectedLanguage)
Create a new editor state with an empty buffer
Note: width/height parameters are kept for backward compatibility but are no longer used - viewport is now owned by SplitViewState. Apply a detected language to this state. This is the single mutation point for changing the language of a buffer after creation.
pub fn new( _width: u16, _height: u16, large_file_threshold: usize, fs: Arc<dyn FileSystem + Send + Sync>, ) -> Self
Sourcepub fn new_with_path(
large_file_threshold: usize,
fs: Arc<dyn FileSystem + Send + Sync>,
path: PathBuf,
) -> Self
pub fn new_with_path( large_file_threshold: usize, fs: Arc<dyn FileSystem + Send + Sync>, path: PathBuf, ) -> Self
Create a new editor state with an empty buffer associated with a file path. Used for files that don’t exist yet — the path is set so saving will create the file.
Sourcepub fn set_language_from_name(&mut self, name: &str, registry: &GrammarRegistry)
pub fn set_language_from_name(&mut self, name: &str, registry: &GrammarRegistry)
Set the syntax highlighting language based on a virtual buffer name.
Handles names like *OLD:test.ts* or *OURS*.c by stripping markers
and detecting language from the cleaned filename.
Sourcepub fn from_file(
path: &Path,
_width: u16,
_height: u16,
large_file_threshold: usize,
registry: &GrammarRegistry,
fs: Arc<dyn FileSystem + Send + Sync>,
) -> Result<Self>
pub fn from_file( path: &Path, _width: u16, _height: u16, large_file_threshold: usize, registry: &GrammarRegistry, fs: Arc<dyn FileSystem + Send + Sync>, ) -> Result<Self>
Create an editor state from a file
Note: width/height parameters are kept for backward compatibility but are no longer used - viewport is now owned by SplitViewState.
Sourcepub fn from_file_with_languages(
path: &Path,
_width: u16,
_height: u16,
large_file_threshold: usize,
registry: &GrammarRegistry,
languages: &HashMap<String, LanguageConfig>,
fs: Arc<dyn FileSystem + Send + Sync>,
) -> Result<Self>
pub fn from_file_with_languages( path: &Path, _width: u16, _height: u16, large_file_threshold: usize, registry: &GrammarRegistry, languages: &HashMap<String, LanguageConfig>, fs: Arc<dyn FileSystem + Send + Sync>, ) -> Result<Self>
Create an editor state from a file with language configuration.
This version uses the provided languages configuration for syntax detection, allowing user-configured filename patterns to be respected for highlighting.
Note: width/height parameters are kept for backward compatibility but are no longer used - viewport is now owned by SplitViewState.
Sourcepub fn from_buffer_with_language(
buffer: Buffer,
detected: DetectedLanguage,
) -> Self
pub fn from_buffer_with_language( buffer: Buffer, detected: DetectedLanguage, ) -> Self
Create an editor state from a buffer and a pre-built DetectedLanguage.
This is useful when you have already loaded a buffer with a specific encoding and want to create an EditorState from it.
Sourcepub fn apply(&mut self, cursors: &mut Cursors, event: &Event)
pub fn apply(&mut self, cursors: &mut Cursors, event: &Event)
Apply an event to the state - THE ONLY WAY TO MODIFY STATE This is the heart of the event-driven architecture
Sourcepub fn capture_displaced_markers(
&self,
range: &Range<usize>,
) -> Vec<(u64, usize)>
pub fn capture_displaced_markers( &self, range: &Range<usize>, ) -> Vec<(u64, usize)>
Capture positions of markers strictly inside a deleted range. Call this BEFORE applying the delete. Returns encoded displaced markers.
Sourcepub fn capture_displaced_markers_bulk(
&self,
edits: &[(usize, usize, String)],
) -> Vec<(u64, usize)>
pub fn capture_displaced_markers_bulk( &self, edits: &[(usize, usize, String)], ) -> Vec<(u64, usize)>
Capture displaced markers for multiple delete ranges (BulkEdit).
Sourcepub fn restore_displaced_markers(&mut self, displaced: &[(u64, usize)])
pub fn restore_displaced_markers(&mut self, displaced: &[(u64, usize)])
Restore displaced markers to their exact original positions.
Sourcepub fn apply_many(&mut self, cursors: &mut Cursors, events: &[Event])
pub fn apply_many(&mut self, cursors: &mut Cursors, events: &[Event])
Apply multiple events in sequence
Sourcepub fn on_focus_lost(&mut self)
pub fn on_focus_lost(&mut self)
Called when this buffer loses focus (e.g., switching to another buffer, opening a prompt, focusing file explorer, etc.) Dismisses transient popups like Hover and Signature Help.
Source§impl EditorState
impl EditorState
Sourcepub fn prepare_for_render(&mut self, top_byte: usize, height: u16) -> Result<()>
pub fn prepare_for_render(&mut self, top_byte: usize, height: u16) -> Result<()>
Prepare viewport for rendering (called before frame render)
This pre-loads all data that will be needed for rendering the current viewport, ensuring that subsequent read-only access during rendering will succeed.
Takes viewport parameters since viewport is now owned by SplitViewState.
Sourcepub fn get_text_range(&mut self, start: usize, end: usize) -> String
pub fn get_text_range(&mut self, start: usize, end: usize) -> String
Get text in a range, driving lazy loading transparently
This is a convenience wrapper around DocumentModel::get_range that:
- Drives lazy loading automatically (never fails due to unloaded data)
- Uses byte offsets directly
- Returns String (not Result) - errors are logged internally
- Returns empty string for invalid ranges
This is the preferred API for getting text ranges. The caller never needs to worry about lazy loading or buffer preparation.
§Example
let text = state.get_text_range(0, 100);Sourcepub fn get_line_at_offset(&mut self, offset: usize) -> Option<(usize, String)>
pub fn get_line_at_offset(&mut self, offset: usize) -> Option<(usize, String)>
Get the content of a line by its byte offset
Returns the line containing the given offset, along with its start position. This uses DocumentModel’s viewport functionality for consistent behavior.
§Returns
Some((line_start_offset, line_content)) if successful, None if offset is invalid
Sourcepub fn get_text_to_end_of_line(&mut self, cursor_pos: usize) -> Result<String>
pub fn get_text_to_end_of_line(&mut self, cursor_pos: usize) -> Result<String>
Get text from current cursor position to end of line
This is a common pattern in editing operations. Uses DocumentModel for consistent behavior across file sizes.
Sourcepub fn set_semantic_tokens(&mut self, store: SemanticTokenStore)
pub fn set_semantic_tokens(&mut self, store: SemanticTokenStore)
Replace cached semantic tokens with a new store.
Sourcepub fn clear_semantic_tokens(&mut self)
pub fn clear_semantic_tokens(&mut self)
Clear cached semantic tokens (e.g., when tokens are invalidated).
Sourcepub fn semantic_tokens_result_id(&self) -> Option<&str>
pub fn semantic_tokens_result_id(&self) -> Option<&str>
Get the server-provided semantic token result_id if available.
Trait Implementations§
Source§impl DocumentModel for EditorState
Implement DocumentModel trait for EditorState
impl DocumentModel for EditorState
Implement DocumentModel trait for EditorState
This provides a clean abstraction layer between rendering/editing operations and the underlying text buffer implementation.
Source§fn capabilities(&self) -> DocumentCapabilities
fn capabilities(&self) -> DocumentCapabilities
Source§fn get_viewport_content(
&mut self,
start_pos: DocumentPosition,
max_lines: usize,
) -> Result<ViewportContent>
fn get_viewport_content( &mut self, start_pos: DocumentPosition, max_lines: usize, ) -> Result<ViewportContent>
Source§fn position_to_offset(&self, pos: DocumentPosition) -> Result<usize>
fn position_to_offset(&self, pos: DocumentPosition) -> Result<usize>
Source§fn offset_to_position(&self, offset: usize) -> DocumentPosition
fn offset_to_position(&self, offset: usize) -> DocumentPosition
Source§fn get_range(
&mut self,
start: DocumentPosition,
end: DocumentPosition,
) -> Result<String>
fn get_range( &mut self, start: DocumentPosition, end: DocumentPosition, ) -> Result<String>
Source§fn get_line_content(&mut self, line_number: usize) -> Option<String>
fn get_line_content(&mut self, line_number: usize) -> Option<String>
Source§fn get_chunk_at_offset(
&mut self,
offset: usize,
size: usize,
) -> Result<(usize, String)>
fn get_chunk_at_offset( &mut self, offset: usize, size: usize, ) -> Result<(usize, String)>
Source§fn insert(&mut self, pos: DocumentPosition, text: &str) -> Result<usize>
fn insert(&mut self, pos: DocumentPosition, text: &str) -> Result<usize>
Source§fn delete(
&mut self,
start: DocumentPosition,
end: DocumentPosition,
) -> Result<()>
fn delete( &mut self, start: DocumentPosition, end: DocumentPosition, ) -> Result<()>
Source§fn replace(
&mut self,
start: DocumentPosition,
end: DocumentPosition,
text: &str,
) -> Result<()>
fn replace( &mut self, start: DocumentPosition, end: DocumentPosition, text: &str, ) -> Result<()>
Source§fn find_matches(
&mut self,
pattern: &str,
search_range: Option<(DocumentPosition, DocumentPosition)>,
) -> Result<Vec<usize>>
fn find_matches( &mut self, pattern: &str, search_range: Option<(DocumentPosition, DocumentPosition)>, ) -> Result<Vec<usize>>
Source§fn has_line_index(&self) -> bool
fn has_line_index(&self) -> bool
Auto Trait Implementations§
impl !Freeze for EditorState
impl !RefUnwindSafe for EditorState
impl !Send for EditorState
impl !Sync for EditorState
impl Unpin for EditorState
impl UnsafeUnpin for EditorState
impl !UnwindSafe for EditorState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<D> OwoColorize for D
impl<D> OwoColorize for D
Source§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
Source§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
Source§fn black(&self) -> FgColorDisplay<'_, Black, Self>
fn black(&self) -> FgColorDisplay<'_, Black, Self>
Source§fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
Source§fn red(&self) -> FgColorDisplay<'_, Red, Self>
fn red(&self) -> FgColorDisplay<'_, Red, Self>
Source§fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
Source§fn green(&self) -> FgColorDisplay<'_, Green, Self>
fn green(&self) -> FgColorDisplay<'_, Green, Self>
Source§fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
Source§fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
Source§fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
Source§fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
Source§fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
Source§fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
Source§fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
Source§fn white(&self) -> FgColorDisplay<'_, White, Self>
fn white(&self) -> FgColorDisplay<'_, White, Self>
Source§fn on_white(&self) -> BgColorDisplay<'_, White, Self>
fn on_white(&self) -> BgColorDisplay<'_, White, Self>
Source§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
Source§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
Source§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
Source§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
Source§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
Source§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
Source§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
Source§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
Source§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
Source§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
Source§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
Source§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
Source§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
Source§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
Source§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
Source§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
Source§fn bold(&self) -> BoldDisplay<'_, Self>
fn bold(&self) -> BoldDisplay<'_, Self>
Source§fn dimmed(&self) -> DimDisplay<'_, Self>
fn dimmed(&self) -> DimDisplay<'_, Self>
Source§fn italic(&self) -> ItalicDisplay<'_, Self>
fn italic(&self) -> ItalicDisplay<'_, Self>
Source§fn underline(&self) -> UnderlineDisplay<'_, Self>
fn underline(&self) -> UnderlineDisplay<'_, Self>
Source§fn blink(&self) -> BlinkDisplay<'_, Self>
fn blink(&self) -> BlinkDisplay<'_, Self>
Source§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
Source§fn reversed(&self) -> ReversedDisplay<'_, Self>
fn reversed(&self) -> ReversedDisplay<'_, Self>
Source§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
Source§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg or
a color-specific method, such as OwoColorize::green, Read moreSource§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg or
a color-specific method, such as OwoColorize::on_yellow, Read more