Skip to content

Commit

Permalink
counsel.el (counsel-dired-jump): Improve
Browse files Browse the repository at this point in the history
  • Loading branch information
abo-abo authored and astoff committed Jan 1, 2021
1 parent 1d3a29f commit 41b60d5
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions counsel.el
Original file line number Diff line number Diff line change
Expand Up @@ -2435,23 +2435,26 @@ INITIAL-DIRECTORY, if non-nil, is used as the root directory for search."
;;** `counsel-dired-jump'
;;;###autoload
(defun counsel-dired-jump (&optional initial-input initial-directory)
"Jump to a directory (in dired) below the current directory.
"Jump to a directory (see `dired-jump') below the current directory.
List all subdirectories within the current directory.
INITIAL-INPUT can be given as the initial minibuffer input.
INITIAL-DIRECTORY, if non-nil, is used as the root directory for search."
(interactive
(list nil
(when current-prefix-arg
(read-directory-name "From directory: "))))
(counsel-require-program "find")
(let* ((default-directory (or initial-directory default-directory)))
(ivy-read "Directory: "
(counsel-require-program find-program)
(let ((default-directory (or initial-directory default-directory)))
(ivy-read "Find directory: "
(split-string
(shell-command-to-string
(concat find-program " " counsel-dired-jump-args))
"\n" t)
:matcher #'counsel--find-file-matcher
:initial-input initial-input
:action (lambda (d) (dired-jump nil (expand-file-name d)))
:history 'file-name-history
:keymap counsel-find-file-map
:caller 'counsel-dired-jump)))

;;* Grep
Expand Down

0 comments on commit 41b60d5

Please sign in to comment.