pub fn from(title: u32, path: &PathBuf) -> Result<Self> {
        // TODO too much assumptions here. Need to clarify.
        debug!("Inside tab::from {:?}", path);
        let p_view: PathBuf = match path.to_str() {
            Some("/") => PathBuf::from("root"),
            Some(e) => PathBuf::from(e)
                .parent()
                .ok_or(ErrorKind::DirNotFound {
                    dirname: format!("Parent for {:?}", e),
                })?.to_path_buf(),
            None => PathBuf::new(),
        };
        // let parent_path = path.parent()
        //     .ok_or(ErrorKind::DirNotFound{dirname: format!("Parent for: {:?}", path.to_str())})?;
        let c_view: PathBuf = PathBuf::from(path);

        Ok(Self {
            title,
            p_view,
            c_view,

            focused: HashMap::new(),
            // p_focused: 0,
            // c_focused: None,
        })
    }
/// Funtion to create a tab from given name and path
Funtion to create a tab from given name and path
Funtion to create a tab from given name and path
pub fn from(title: u32, path: &PathBuf) -> Result<Self> {
        // TODO too much assumptions here. Need to clarify.
        debug!("Inside tab::from {:?}", path);
        let p_view: PathBuf = match path.to_str() {
            Some("/") => PathBuf::from("root"),
            Some(e) => PathBuf::from(e)
                .parent()
                .ok_or(ErrorKind::DirNotFound {
                    dirname: format!("Parent for {:?}", e),
                })?.to_path_buf(),
            None => PathBuf::new(),
        };
        // let parent_path = path.parent()
        //     .ok_or(ErrorKind::DirNotFound{dirname: format!("Parent for: {:?}", path.to_str())})?;
        let c_view: PathBuf = PathBuf::from(path);
        Ok(Self {
            title,
            p_view,
            c_view,
            focused: HashMap::new(),
            // p_focused: 0,
            // c_focused: None,
        })
    }
pub fn from ( title : u32 , path : & PathBuf ) -> Result < Self > { // TODO too much assumptions here. Need to clarify. debug ! ( " " path ) ; let p_view : PathBuf = match path . to_str ( ) { Some ( " " ) => PathBuf :: from ( " " ) , Some ( e ) => PathBuf :: from ( e ) . parent ( ) . ok_or ( ErrorKind :: DirNotFound { dirname : format ! ( " " e ) , } ) ? . to_path_buf ( ) , None => PathBuf :: new ( ) , } ; // let parent_path = path.parent() //     .ok_or(ErrorKind::DirNotFound{dirname: format!("Parent for: {:?}", path.to_str())})?; let c_view : PathBuf = PathBuf :: from ( path ) ; Ok ( Self { title , p_view , c_view , focused : HashMap :: new ( ) , // p_focused: 0, // c_focused: None, } ) }
Funtion to create a tab from given name and path
Funtion to create a tab from given name and path
title
u32
path
&PathBuf
title
u32
path
&PathBuf