pub struct CodeBlockInfo {
pub rows_span: Range<usize>,
pub lang: Option<String>,
}Expand description
A fenced or indented code block, named by the VisualMap::rows it occupies.
Unlike a table, the rows are the block’s content — a frontend still paints
them, it just draws a border and a tinted background around the whole span
and lets the code inside scroll horizontally instead of wrapping. So this
carries only the row range; there’s no structural alternative to the picture
the way TableInfo is one. Derived from VRow::code — see
[code_block_spans].
Fields§
§rows_span: Range<usize>The contiguous run of VisualMap::rows this code block spans, blank
code lines included.
lang: Option<String>The block’s language, from a fenced block’s info string — what a frontend
paints as a small label on the box (```rust → Some("rust")).
None for a fence written without one, or an indented block. Editing it
goes through crate::Doc::set_code_language, which re-finds the fence
in the AST, so this stays a display string.
Trait Implementations§
Source§impl Clone for CodeBlockInfo
impl Clone for CodeBlockInfo
Source§fn clone(&self) -> CodeBlockInfo
fn clone(&self) -> CodeBlockInfo
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more