Skip to content

Commit

Permalink
counsel.el (counsel-file-jump): Fix file expansion
Browse files Browse the repository at this point in the history
Expand candidate file names relative to original default-directory,
not that of ivy-state-window (ivy--directory seems to always be nil
in the action function).

Fixes abo-abo#1903
  • Loading branch information
basil-conto committed Feb 17, 2019
1 parent 22fca55 commit 2a02343
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions counsel.el
Expand Up @@ -2473,18 +2473,16 @@ INITIAL-DIRECTORY, if non-nil, is used as the root directory for search."
(list nil
(when current-prefix-arg
(read-directory-name "From directory: "))))
(counsel-require-program "find")
(let* ((default-directory (or initial-directory default-directory)))
(counsel-require-program find-program)
(let ((default-directory (or initial-directory default-directory)))
(ivy-read "Find file: "
(split-string
(shell-command-to-string
(concat find-program " " counsel-file-jump-args))
"\n" t)
:matcher #'counsel--find-file-matcher
:initial-input initial-input
:action (lambda (x)
(with-ivy-window
(find-file (expand-file-name x ivy--directory))))
:action #'find-file
:preselect (counsel--preselect-file)
:require-match 'confirm-after-completion
:history 'file-name-history
Expand Down

0 comments on commit 2a02343

Please sign in to comment.