pub fn load_bindings(&mut self) {
        let v_clone = self.vec_tabs.clone();
        self.siv.add_global_callback('h', move |s: &mut Cursive| {
            debug!("Inside global callback h");
            // Get current_view selection index
            let mut current_selection = None;
            s.call_on_id(
                "current",
                |event_view: &mut OnEventView<MultiSelectView<PathBuf>>| {
                    let view = event_view.get_inner();
                    current_selection = view.selected_id();
                },
            );
            if let Some(mut tab) = v_clone.borrow_mut().get_mut(&1) {
                tab.focused
                    .insert(PathBuf::from(&tab.c_view), current_selection.unwrap_or(0));
                tab.go_back();
                // tab.c_focused = current_selection;
                App::update_tab(s, &mut tab);
                s.call_on_id("topbar/center", |view: &mut TextView| {
                    let mut text: TextContent = view.get_shared_content();
                    text.set_content(format!(" {}", tab.c_view.to_str().unwrap()));
                });
            };
        });

        let v_clone2 = self.vec_tabs.clone();
        self.siv.add_global_callback('l', move |s: &mut Cursive| {
            s.call_on_id(
                "current",
                |event_view: &mut OnEventView<MultiSelectView<PathBuf>>| {
                    let event = event_view.get_inner_mut();
                    if let Some(path) = event.selection() {
                        if path.is_dir() {
                            if let Some(mut tab) = v_clone2.borrow_mut().get_mut(&1) {
                                debug!("Moving forward to path {:?}", path);
                                tab.go_forward(path.to_path_buf());
                            };
                        } // if
                    };
                },
            );
            if let Some(mut tab) = v_clone2.borrow_mut().get_mut(&1) {
                App::update_tab(s, &mut tab);
                s.call_on_id("topbar/center", |view: &mut TextView| {
                    let mut text = view.get_shared_content();
                    text.set_content(format!(" {}",tab.c_view.to_str().unwrap()));
                });
            }
        });

        self.siv.call_on_id(
            "current",
            |event_view: &mut OnEventView<MultiSelectView<PathBuf>>| {
                event_view.set_on_pre_event_inner('k', |s| {
                    let cb = s.select_up(1);
                    Some(EventResult::Consumed(Some(cb)))
                });
                event_view.set_on_pre_event_inner('j', |s| {
                    let cb = s.select_down(1);
                    Some(EventResult::Consumed(Some(cb)))
                });
            },
        );

        self.siv.add_global_callback('/', |c: &mut Cursive| {
            debug!("You pressed search key");
            c.add_layer(create_console("/"));
            let s = c.screen_mut();
            let l = LayerPosition::FromFront(0);
            let pos = s.offset().saturating_add((9000, 9000));
            let p = Position::absolute(pos);
            s.reposition_layer(l, p);
        });

        self.siv.add_global_callback('?', |c: &mut Cursive| {
            debug!("You pressed search key");
            c.add_layer(create_console("?"));
            let s = c.screen_mut();
            let l = LayerPosition::FromFront(0);
            let pos = s.offset().saturating_add((9000, 9000));
            let p = Position::absolute(pos);
            s.reposition_layer(l, p);
        });

        // Cancels current action.
        self.siv.add_global_callback(Event::Key(Key::Esc), |s: &mut Cursive| {
            let mut exists: bool = false;
            {
                let stack_view = s.screen_mut();
                if let Some(_data) = stack_view.get(LayerPosition::FromBack(1)) {
                    debug!("Multiple layer found");
                    exists = true;
                }
            }
            if exists {s.pop_layer();}
        });
    }
/// Funtion to load key-bindings.
Funtion to load key-bindings.
Funtion to load key - bindings .
pub fn load_bindings(&mut self) {
        let v_clone = self.vec_tabs.clone();
        self.siv.add_global_callback('h', move |s: &mut Cursive| {
            debug!("Inside global callback h");
            // Get current_view selection index
            let mut current_selection = None;
            s.call_on_id(
                "current",
                |event_view: &mut OnEventView<MultiSelectView<PathBuf>>| {
                    let view = event_view.get_inner();
                    current_selection = view.selected_id();
                },
            );
            if let Some(mut tab) = v_clone.borrow_mut().get_mut(&1) {
                tab.focused
                    .insert(PathBuf::from(&tab.c_view), current_selection.unwrap_or(0));
                tab.go_back();
                // tab.c_focused = current_selection;
                App::update_tab(s, &mut tab);
                s.call_on_id("topbar/center", |view: &mut TextView| {
                    let mut text: TextContent = view.get_shared_content();
                    text.set_content(format!(" {}", tab.c_view.to_str().unwrap()));
                });
            };
        });
        let v_clone2 = self.vec_tabs.clone();
        self.siv.add_global_callback('l', move |s: &mut Cursive| {
            s.call_on_id(
                "current",
                |event_view: &mut OnEventView<MultiSelectView<PathBuf>>| {
                    let event = event_view.get_inner_mut();
                    if let Some(path) = event.selection() {
                        if path.is_dir() {
                            if let Some(mut tab) = v_clone2.borrow_mut().get_mut(&1) {
                                debug!("Moving forward to path {:?}", path);
                                tab.go_forward(path.to_path_buf());
                            };
                        } // if
                    };
                },
            );
            if let Some(mut tab) = v_clone2.borrow_mut().get_mut(&1) {
                App::update_tab(s, &mut tab);
                s.call_on_id("topbar/center", |view: &mut TextView| {
                    let mut text = view.get_shared_content();
                    text.set_content(format!(" {}",tab.c_view.to_str().unwrap()));
                });
            }
        });
        self.siv.call_on_id(
            "current",
            |event_view: &mut OnEventView<MultiSelectView<PathBuf>>| {
                event_view.set_on_pre_event_inner('k', |s| {
                    let cb = s.select_up(1);
                    Some(EventResult::Consumed(Some(cb)))
                });
                event_view.set_on_pre_event_inner('j', |s| {
                    let cb = s.select_down(1);
                    Some(EventResult::Consumed(Some(cb)))
                });
            },
        );
        self.siv.add_global_callback('/', |c: &mut Cursive| {
            debug!("You pressed search key");
            c.add_layer(create_console("/"));
            let s = c.screen_mut();
            let l = LayerPosition::FromFront(0);
            let pos = s.offset().saturating_add((9000, 9000));
            let p = Position::absolute(pos);
            s.reposition_layer(l, p);
        });
        self.siv.add_global_callback('?', |c: &mut Cursive| {
            debug!("You pressed search key");
            c.add_layer(create_console("?"));
            let s = c.screen_mut();
            let l = LayerPosition::FromFront(0);
            let pos = s.offset().saturating_add((9000, 9000));
            let p = Position::absolute(pos);
            s.reposition_layer(l, p);
        });
        // Cancels current action.
        self.siv.add_global_callback(Event::Key(Key::Esc), |s: &mut Cursive| {
            let mut exists: bool = false;
            {
                let stack_view = s.screen_mut();
                if let Some(_data) = stack_view.get(LayerPosition::FromBack(1)) {
                    debug!("Multiple layer found");
                    exists = true;
                }
            }
            if exists {s.pop_layer();}
        });
    }
pub fn load_bindings ( & mut self ) { let v_clone = self . vec_tabs . clone ( ) ; self . siv . add_global_callback ( 'h' , move | s : & mut Cursive | { debug ! ( " " ) ; // Get current_view selection index let mut current_selection = None ; s . call_on_id ( " " , | event_view : & mut OnEventView < MultiSelectView < PathBuf > > | { let view = event_view . get_inner ( ) ; current_selection = view . selected_id ( ) ; } , ) ; if let Some ( mut tab ) = v_clone . borrow_mut ( ) . get_mut ( & 1 ) { tab . focused . insert ( PathBuf :: from ( & tab . c_view ) , current_selection . unwrap_or ( 0 ) ) ; tab . go_back ( ) ; // tab.c_focused = current_selection; App :: update_tab ( s , & mut tab ) ; s . call_on_id ( " " , | view : & mut TextView | { let mut text : TextContent = view . get_shared_content ( ) ; text . set_content ( format ! ( " " tab c_view to_str ( ) unwrap ( ) ) ) ; } ) ; } ; } ) ; let v_clone2 = self . vec_tabs . clone ( ) ; self . siv . add_global_callback ( 'l' , move | s : & mut Cursive | { s . call_on_id ( " " , | event_view : & mut OnEventView < MultiSelectView < PathBuf > > | { let event = event_view . get_inner_mut ( ) ; if let Some ( path ) = event . selection ( ) { if path . is_dir ( ) { if let Some ( mut tab ) = v_clone2 . borrow_mut ( ) . get_mut ( & 1 ) { debug ! ( " " path ) ; tab . go_forward ( path . to_path_buf ( ) ) ; } ; } // if } ; } , ) ; if let Some ( mut tab ) = v_clone2 . borrow_mut ( ) . get_mut ( & 1 ) { App :: update_tab ( s , & mut tab ) ; s . call_on_id ( " " , | view : & mut TextView | { let mut text = view . get_shared_content ( ) ; text . set_content ( format ! ( " " tab c_view to_str ( ) unwrap ( ) ) ) ; } ) ; } } ) ; self . siv . call_on_id ( " " , | event_view : & mut OnEventView < MultiSelectView < PathBuf > > | { event_view . set_on_pre_event_inner ( 'k' , | s | { let cb = s . select_up ( 1 ) ; Some ( EventResult :: Consumed ( Some ( cb ) ) ) } ) ; event_view . set_on_pre_event_inner ( 'j' , | s | { let cb = s . select_down ( 1 ) ; Some ( EventResult :: Consumed ( Some ( cb ) ) ) } ) ; } , ) ; self . siv . add_global_callback ( '/' , | c : & mut Cursive | { debug ! ( " " ) ; c . add_layer ( create_console ( " " ) ) ; let s = c . screen_mut ( ) ; let l = LayerPosition :: FromFront ( 0 ) ; let pos = s . offset ( ) . saturating_add ( ( 9000 , 9000 ) ) ; let p = Position :: absolute ( pos ) ; s . reposition_layer ( l , p ) ; } ) ; self . siv . add_global_callback ( '?' , | c : & mut Cursive | { debug ! ( " " ) ; c . add_layer ( create_console ( " " ) ) ; let s = c . screen_mut ( ) ; let l = LayerPosition :: FromFront ( 0 ) ; let pos = s . offset ( ) . saturating_add ( ( 9000 , 9000 ) ) ; let p = Position :: absolute ( pos ) ; s . reposition_layer ( l , p ) ; } ) ; // Cancels current action. self . siv . add_global_callback ( Event :: Key ( Key :: Esc ) , | s : & mut Cursive | { let mut exists : bool = false ; { let stack_view = s . screen_mut ( ) ; if let Some ( _data ) = stack_view . get ( LayerPosition :: FromBack ( 1 ) ) { debug ! ( " " ) ; exists = true ; } } if exists { s . pop_layer ( ) ; } } ) ; }
Funtion to load key-bindings.
Funtion to load key - bindings .
&mut self
&mut self