-
-
Notifications
You must be signed in to change notification settings - Fork 339
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
select previous directory on ivy--cd
#1257
Comments
Thanks, please test. |
Confirm. Nice, thank you! |
Sorry, but I had to revert the change. The same code is used for basically all completion. With this change, moving a file to its parent's parent became harder. I don't think it's a worthwhile trade-off for one-item history. We can add a better history later if it's required, but it won't be on DEL. |
@abo-abo could you reopen this issue then? Didn't know that For now I just use additional command based on your changes: (defun ivy-backward-directory ()
"Forward to `kill-start-of-line'.
On error (read-only), call `ivy-on-del-error-function'."
(interactive)
(if (and ivy--directory (= (minibuffer-prompt-end) (point)))
(progn
(let ((old-dir (file-name-nondirectory
(directory-file-name ivy--directory)))
idx)
(ivy--cd (file-name-directory
(directory-file-name
(expand-file-name
ivy--directory))))
(ivy--exhibit)
(when (setq idx (cl-position
(file-name-as-directory old-dir)
ivy--old-cands
:test 'equal))
(ivy-set-index idx))))
(condition-case nil
(kill-start-of-line) ; a little different here
(error
(when ivy-on-del-error-function
(funcall ivy-on-del-error-function))))))
(eval-after-load 'ivy
'(progn
(define-key ivy-minibuffer-map (kbd "C-l") 'ivy-backward-directory)
(...))) |
Perhaps as common solution it would be better to add separate keymap for |
Since you asked, I reopen the issue. I try my best to make available the necessary facilities for customization. But without special care, more customization can mean less consistency: just like we saw in the above commit.
|
When I call
counsel-find-file
, and jump to parent directory,I actually see first item
.
selected.What I expect to see is previous directory selected (like
helm-find-file
does).Is it possible to customize
swiper
this way?The text was updated successfully, but these errors were encountered: