From 4cf4a19c69b4365d8e5e34e7b35ed6f7cc03233c Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 3 Jul 2025 12:21:42 +0530 Subject: [PATCH] Fix changing dir when possible not working if entry is actual dir --- kittens/choose_files/main.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/kittens/choose_files/main.go b/kittens/choose_files/main.go index ddbd8b6dc..9078aeee2 100644 --- a/kittens/choose_files/main.go +++ b/kittens/choose_files/main.go @@ -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() } }