Struct text_lines::TextLines [−][src]
pub struct TextLines { /* fields omitted */ }
Implementations
Creates a new TextLines
with the specified text and default
indent width of 4.
Creates a new TextLines
with the specified text and indent width.
The indent width sets the width of a tab character when getting
the display column.
Gets the number of lines in the text.
Gets the text length in bytes.
Gets the line index from a byte index. Note that if you provide the middle byte index of a \r\n newline then it will return the index of the line the preceding line.
Gets the line start byte index.
Gets the line end byte index (before/at the newline character).
Gets the byte position from the provided line and column index.
Gets the line and column index of the provided byte index.
Gets the line and column display based on the indentation width and the provided byte index.
pub fn line_and_column_display_with_indent_width(
&self,
byte_index: usize,
indent_width: usize
) -> LineAndColumnDisplay
pub fn line_and_column_display_with_indent_width(
&self,
byte_index: usize,
indent_width: usize
) -> LineAndColumnDisplay
Gets the line and column display based on the provided byte index and indentation width.