pub fn curr_sel(&self) -> Option<Cow<str>> {
        if let Some(anchor) = self.selection.anchor {
            let anchor_idx = self.rope_idx(anchor, 0);
            let focus_idx = self.rope_idx(self.selection.focus, 0);
            let slice = if focus_idx < anchor_idx {
                self.buf.slice(focus_idx..anchor_idx)
            } else {
                self.buf.slice(anchor_idx..focus_idx)
            };
            Some(Cow::from(trimmed(slice)))
        } else {
            None
        }
    }
/// Get the current selection of text.
Get the current selection of text.
Get the current selection of text .
pub fn curr_sel(&self) -> Option<Cow<str>> {
        if let Some(anchor) = self.selection.anchor {
            let anchor_idx = self.rope_idx(anchor, 0);
            let focus_idx = self.rope_idx(self.selection.focus, 0);
            let slice = if focus_idx < anchor_idx {
                self.buf.slice(focus_idx..anchor_idx)
            } else {
                self.buf.slice(anchor_idx..focus_idx)
            };
            Some(Cow::from(trimmed(slice)))
        } else {
            None
        }
    }
pub fn curr_sel ( & self ) -> Option < Cow < str > > { if let Some ( anchor ) = self . selection . anchor { let anchor_idx = self . rope_idx ( anchor , 0 ) ; let focus_idx = self . rope_idx ( self . selection . focus , 0 ) ; let slice = if focus_idx < anchor_idx { self . buf . slice ( focus_idx .. anchor_idx ) } else { self . buf . slice ( anchor_idx .. focus_idx ) } ; Some ( Cow :: from ( trimmed ( slice ) ) ) } else { None } }
Get the current selection of text.
Get the current selection of text .
&self
&self