pub(crate) fn insert_str(&mut self, str: &str) {
        self.clamp();
        if let Some(anchor) = self.selection.anchor {
            self.delete_selection(self.selection.focus, anchor);
        }
        let z = self.rope_idx(self.selection.focus, 0);
        self.buf.insert(z, str);

        let lines = str.lines().count().max(1);

        self.selection.focus.ln += lines - 1;
        self.selection.focus.col = self.selection.focus.col + str.lines().last().unwrap_or_default().len();
    }
/// Insert a string at the cursor.
Insert a string at the cursor.
Insert a string at the cursor .
pub(crate) fn insert_str(&mut self, str: &str) {
        self.clamp();
        if let Some(anchor) = self.selection.anchor {
            self.delete_selection(self.selection.focus, anchor);
        }
        let z = self.rope_idx(self.selection.focus, 0);
        self.buf.insert(z, str);
        let lines = str.lines().count().max(1);
        self.selection.focus.ln += lines - 1;
        self.selection.focus.col = self.selection.focus.col + str.lines().last().unwrap_or_default().len();
    }
pub ( crate ) fn insert_str ( & mut self , str : & str ) { self . clamp ( ) ; if let Some ( anchor ) = self . selection . anchor { self . delete_selection ( self . selection . focus , anchor ) ; } let z = self . rope_idx ( self . selection . focus , 0 ) ; self . buf . insert ( z , str ) ; let lines = str . lines ( ) . count ( ) . max ( 1 ) ; self . selection . focus . ln += lines - 1 ; self . selection . focus . col = self . selection . focus . col + str . lines ( ) . last ( ) . unwrap_or_default ( ) . len ( ) ; }
Insert a string at the cursor.
Insert a string at the cursor .
&mut self
str
&str
&mut self
str
&str