fn from(rt: RawTerm) -> io::Result<Editor> {
        let (rows, cols) = get_window_size()?;
        Ok(Editor {
               _term: rt,
               // leave two rows for status
               screenrows: (rows - 2) as usize,
               screencols: cols as usize,
               position: Default::default(),
               rx: 0,
               rows: Vec::new(),
               filename: String::new(),
               dirty: false,
               quit_times: QUIT_TIMES,
               status_msg: "".to_owned(),
               status_time: Timespec::new(0, 0),
               syntax: NO_SYNTAX,
           })
    }
/// Create a Editor struct from a Rawterm struct
Create a Editor struct from a Rawterm struct
Create a Editor struct from a Rawterm struct
fn from(rt: RawTerm) -> io::Result<Editor> {
        let (rows, cols) = get_window_size()?;
        Ok(Editor {
               _term: rt,
               // leave two rows for status
               screenrows: (rows - 2) as usize,
               screencols: cols as usize,
               position: Default::default(),
               rx: 0,
               rows: Vec::new(),
               filename: String::new(),
               dirty: false,
               quit_times: QUIT_TIMES,
               status_msg: "".to_owned(),
               status_time: Timespec::new(0, 0),
               syntax: NO_SYNTAX,
           })
    }
fn from ( rt : RawTerm ) -> io :: Result < Editor > { let ( rows , cols ) = get_window_size ( ) ? ; Ok ( Editor { _term : rt , // leave two rows for status screenrows : ( rows - 2 ) as usize , screencols : cols as usize , position : Default :: default ( ) , rx : 0 , rows : Vec :: new ( ) , filename : String :: new ( ) , dirty : false , quit_times : QUIT_TIMES , status_msg : " " . to_owned ( ) , status_time : Timespec :: new ( 0 , 0 ) , syntax : NO_SYNTAX , } ) }
Create a Editor struct from a Rawterm struct
Create a Editor struct from a Rawterm struct
rt
RawTerm