fn delete_by_movement(&mut self, movement: Movement, save: bool) {
        // We compute deletions as a selection because the merge logic is convenient.
        // Another possibility would be to make the delta builder be able to handle
        // overlapping deletions (using union semantics).
        let mut deletions = Selection::new();
        for r in self.view.sel_regions() {
            if r.is_caret() {
                let new_region = region_movement(movement, r, &self.view, &self.text, true);
                deletions.add_region(new_region);
            } else {
                deletions.add_region(r.clone());
            }
        }
        if save {
            let saved = self.extract_sel_regions(&deletions).unwrap_or(String::new());
            self.doc_ctx.set_kill_ring(Rope::from(saved));
        }
        self.delete_sel_regions(&deletions);
    }
/// Common logic for a number of delete methods. For each region in the selection,
/// if the selection is a caret, delete the region between the caret and the
/// movement applied to the caret, otherwise delete the region.
///
/// If `save` is set, save the deleted text into the kill ring.
Common logic for a number of delete methods. For each region in the selection,
if the selection is a caret, delete the region between the caret and the
movement applied to the caret, otherwise delete the region.

If `save` is set, save the deleted text into the kill ring.
Common logic for a number of delete methods . For each region in the selection if the selection is a caret delete the region between the caret and the movement applied to the caret otherwise delete the region . If ` save ` is set save the deleted text into the kill ring .
fn delete_by_movement(&mut self, movement: Movement, save: bool) {
        // We compute deletions as a selection because the merge logic is convenient.
        // Another possibility would be to make the delta builder be able to handle
        // overlapping deletions (using union semantics).
        let mut deletions = Selection::new();
        for r in self.view.sel_regions() {
            if r.is_caret() {
                let new_region = region_movement(movement, r, &self.view, &self.text, true);
                deletions.add_region(new_region);
            } else {
                deletions.add_region(r.clone());
            }
        }
        if save {
            let saved = self.extract_sel_regions(&deletions).unwrap_or(String::new());
            self.doc_ctx.set_kill_ring(Rope::from(saved));
        }
        self.delete_sel_regions(&deletions);
    }
fn delete_by_movement ( & mut self , movement : Movement , save : bool ) { // We compute deletions as a selection because the merge logic is convenient. // Another possibility would be to make the delta builder be able to handle // overlapping deletions (using union semantics). let mut deletions = Selection :: new ( ) ; for r in self . view . sel_regions ( ) { if r . is_caret ( ) { let new_region = region_movement ( movement , r , & self . view , & self . text , true ) ; deletions . add_region ( new_region ) ; } else { deletions . add_region ( r . clone ( ) ) ; } } if save { let saved = self . extract_sel_regions ( & deletions ) . unwrap_or ( String :: new ( ) ) ; self . doc_ctx . set_kill_ring ( Rope :: from ( saved ) ) ; } self . delete_sel_regions ( & deletions ) ; }
Common logic for a number of delete methods.
Common logic for a number of delete methods .
&mut self
movement
Movement
save
bool