fix(file-manager): open the selection with Enter instead of changing directory
Enter quit the panel and cd'ed the shell, which silently did nothing when the panel ran in a dock, where there is no shell to move. Enter now behaves like the right arrow and descends into a directory in place, while Ctrl+Enter keeps the shell directory change and no longer depends on the selection.
This commit is contained in:
4 files changed
+33
-30
No files matched your search
@@ -395,20 +395,20 @@ func (h *Handler) copy_selected_path() {
|
||||
h.draw_screen()
|
||||
}
|
||||
|
||||
// activate implements the primary action: the selected directory becomes the
|
||||
// working directory of the shell, the selected file is opened in the editor.
|
||||
// activate implements the primary action: the selected directory is opened in
|
||||
// the panel, the selected file is opened in the editor. Enter used to quit the
|
||||
// panel and cd the shell, which did nothing when the panel was docked.
|
||||
func (h *Handler) activate() {
|
||||
e, ok := h.selected_entry()
|
||||
if !ok {
|
||||
h.lp.Beep()
|
||||
return
|
||||
}
|
||||
path := entry_path(h.cwd, e.Name)
|
||||
if e.IsDir {
|
||||
h.change_shell_dir_to(path)
|
||||
h.enter_dir()
|
||||
return
|
||||
}
|
||||
h.open_file(path)
|
||||
h.open_file(entry_path(h.cwd, e.Name))
|
||||
}
|
||||
|
||||
// edit_args is the client side of kitty's edit protocol. The terminal opens the
|
||||
@@ -766,7 +766,7 @@ func (h *Handler) draw_screen() {
|
||||
h.lp.QueueWriteString(h.lp.SprintStyled("bold fg=bright-red", fmt.Sprintf("Delete %s? [y/N] ", h.confirm_name)))
|
||||
default:
|
||||
h.lp.SetCursorVisible(false)
|
||||
hints := "Enter: cd/open ->: enter <-: up .: hidden n: new file r: rename d: delete y: copy q: quit"
|
||||
hints := "Enter: open ->: enter Ctrl+Enter: cd here <-: up .: hidden n: new file r: rename d: delete y: copy q: quit"
|
||||
h.lp.QueueWriteString(h.lp.SprintStyled("dim", truncate_to_width(hints, width)))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user