Struct reedline::StyledText
source · Expand description
A representation of a buffer with styling, used for doing syntax highlighting
Fields§
§buffer: Vec<(Style, String)>
The component, styled parts of the text
Implementations§
source§impl StyledText
impl StyledText
sourcepub fn render_around_insertion_point(
&self,
insertion_point: usize,
prompt: &dyn Prompt,
use_ansi_coloring: bool
) -> (String, String)
pub fn render_around_insertion_point(
&self,
insertion_point: usize,
prompt: &dyn Prompt,
use_ansi_coloring: bool
) -> (String, String)
Render the styled string. We use the insertion point to render around so that we can properly write out the styled string to the screen and find the correct place to put the cursor. This assumes a logic that prints the first part of the string, saves the cursor position, prints the second half, and then restores the cursor position
Also inserts the multiline continuation prompt
sourcepub fn render_simple(&self) -> String
pub fn render_simple(&self) -> String
Apply the ANSI style formatting to the full string.
sourcepub fn raw_string(&self) -> String
pub fn raw_string(&self) -> String
Get the unformatted text as a single continuous string.