Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
select previous directory on `ivy--cd` #1257
added a commit
Nov 3, 2017
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.