Skip to main content

extract_text

Function extract_text 

Source
pub fn extract_text(
    anchor: TextPos,
    cursor: TextPos,
    wrap: &PanelWrap,
    exclude: Option<&HashSet<TextPos>>,
) -> Option<String>
Expand description

Extract the selected text (lines joined with \n) between two logical positions. Cost is proportional only to the selected lines themselves (via PanelWrap::line_text’s O(1) slicing), never the panel’s total content size. None when there’s nothing to select (no content, or a purely blank selection). exclude, when given, drops any character whose position is in the set — used to keep purely-visual annotations (like the Request panel’s shadow-warning icon; see TuiApp::main_shadow_icon_positions) out of copied text even though they’re part of what’s shown on screen.