Fix changing dir when possible not working if entry is actual dir
This commit is contained in:
parent
115227e61a
commit
4cf4a19c69
1 changed files with 2 additions and 4 deletions
|
|
@ -275,14 +275,12 @@ func (h *Handler) set_query(q string) {
|
|||
}
|
||||
|
||||
func (h *Handler) change_to_current_dir_if_possible() error {
|
||||
matches, _ := h.get_results()
|
||||
if matches.Len() > 0 {
|
||||
m := h.current_abspath()
|
||||
if m := h.current_abspath(); m != "" {
|
||||
if st, err := os.Stat(m); err == nil {
|
||||
if !st.IsDir() {
|
||||
m = filepath.Dir(m)
|
||||
h.change_current_dir(m)
|
||||
}
|
||||
h.change_current_dir(m)
|
||||
return h.draw_screen()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue