pub fn delete_line(&mut self, line: usize) {
        let end = if self.is_last_line(line) {
            Position::new(line, self.line_width(line).unwrap())
        } else {
            Position::new(line + 1, 0)
        };
        self.delete_range(Position::new(line, 0)..end);
    }
/// Deletes a line from the buffer.
///
/// # Examples
///
/// ```
/// # use edit::editor::Editor;
/// let mut editor = Editor::new("a a\n\
///                               b b b", 1, 3).unwrap();
/// editor.delete_line(0);
///
/// assert_eq!(editor.buffer_as_str(), "b b b");
/// assert_eq!(editor.line(), 0);
/// assert_eq!(editor.column(), 3);
///
/// editor.delete_line(0);
///
/// assert_eq!(editor.buffer_as_str(), "");
/// assert_eq!(editor.line(), 0);
/// assert_eq!(editor.column(), 0);
///
/// let mut editor = Editor::new("a b", 0, 2).unwrap();
/// editor.delete_line(0);
///
/// assert_eq!(editor.buffer_as_str(), "");
/// assert_eq!(editor.line(), 0);
/// assert_eq!(editor.column(), 0);
/// ```
Deletes a line from the buffer.
Deletes a line from the buffer .
pub fn delete_line(&mut self, line: usize) {
        let end = if self.is_last_line(line) {
            Position::new(line, self.line_width(line).unwrap())
        } else {
            Position::new(line + 1, 0)
        };
        self.delete_range(Position::new(line, 0)..end);
    }
pub fn delete_line ( & mut self , line : usize ) { let end = if self . is_last_line ( line ) { Position :: new ( line , self . line_width ( line ) . unwrap ( ) ) } else { Position :: new ( line + 1 , 0 ) } ; self . delete_range ( Position :: new ( line , 0 ) .. end ) ; }
Deletes a line from the buffer.
Deletes a line from the buffer .
&mut self
line
usize
&mut self
line
usize
examples
None
use edit::editor::editor;
let mut editor = Editor::new("a a\n\
b b b", 1, 3).unwrap();
editor.delete_line(0).

assert_eq!(editor.buffer_as_str(), "b b b");
assert_eq!(editor.line(), 0);
assert_eq!(editor.column(), 3).

editor.delete_line(0).



let mut editor = Editor::new("a b", 0, 2).unwrap();
editor.delete_line(0).


let mut editor = Editor :: new ( " a a \ n \ b b b " 1 3 ) . unwrap () ; editor . delete_line ( 0 ) . assert_eq! ( editor . buffer_as_str () " b b b " ) ; assert_eq! ( editor . line () 0 ) ; assert_eq! ( editor . column () 3 ) . editor . delete_line ( 0 ) . let mut editor = Editor :: new ( " a b " 0 2 ) . unwrap () ; editor . delete_line ( 0 ) .