[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ivy-hydra f1472ef 266/395: ivy.el: When completing file
From: |
Basil L. Contovounesios |
Subject: |
[elpa] externals/ivy-hydra f1472ef 266/395: ivy.el: When completing files, make "RET" reverse "DEL" |
Date: |
Thu, 25 Feb 2021 08:32:17 -0500 (EST) |
branch: externals/ivy-hydra
commit f1472ef26f5b9506d1f23fc713046feb708ed5cc
Author: Oleh Krehel <ohwoeowho@gmail.com>
Commit: Oleh Krehel <ohwoeowho@gmail.com>
ivy.el: When completing files, make "RET" reverse "DEL"
Re #1424
---
ivy.el | 25 ++++++++++++++++++++-----
1 file changed, 20 insertions(+), 5 deletions(-)
diff --git a/ivy.el b/ivy.el
index 52ee616..e77e5a7 100644
--- a/ivy.el
+++ b/ivy.el
@@ -561,6 +561,10 @@ of `history-length'.")
(defvar ivy--directory nil
"Current directory when completing file names.")
+(defvar ivy--directory-hist nil
+ "Store the history of directories.
+This allows RET to reverse consecutive DEL.")
+
(defvar ivy--length 0
"Store the amount of viable candidates.")
@@ -1680,7 +1684,15 @@ If so, move to that directory, while keeping only the
file name."
#'string<))))
(ivy-set-text "")
(setf (ivy-state-directory ivy-last) dir)
- (delete-minibuffer-contents)))
+ (delete-minibuffer-contents)
+ (when (equal dir (car ivy--directory-hist))
+ (pop ivy--directory-hist)
+ (setf (ivy-state-preselect ivy-last)
+ (if ivy--directory-hist
+ (file-name-nondirectory
+ (directory-file-name
+ (car ivy--directory-hist)))
+ nil)))))
(defun ivy--parent-dir (filename)
"Return parent directory of absolute FILENAME."
@@ -1693,10 +1705,12 @@ there is no more text to delete at the beginning of the
minibuffer."
(interactive)
(if (and ivy--directory (= (minibuffer-prompt-end) (point)))
- (if (fboundp 'counsel-up-directory)
- (counsel-up-directory)
- (ivy--cd (ivy--parent-dir (expand-file-name ivy--directory)))
- (ivy--exhibit))
+ (progn
+ (push ivy--directory ivy--directory-hist)
+ (if (fboundp 'counsel-up-directory)
+ (counsel-up-directory)
+ (ivy--cd (ivy--parent-dir (expand-file-name ivy--directory)))
+ (ivy--exhibit)))
(setq prefix-arg current-prefix-arg)
(condition-case nil
(call-interactively #'delete-backward-char)
@@ -2347,6 +2361,7 @@ This is useful for recursive `ivy-read'."
(def (ivy-state-def state)))
(setq ivy--extra-candidates (ivy--compute-extra-candidates caller))
(setq ivy--directory nil)
+ (setq ivy--directory-hist nil)
(setq ivy-case-fold-search ivy-case-fold-search-default)
(setf (ivy-state-re-builder ivy-last)
(setq ivy--regex-function
- [elpa] externals/ivy-hydra b40af52 267/395: counsel.el (counsel-find-file-undo): Remap undo, (continued)
- [elpa] externals/ivy-hydra b40af52 267/395: counsel.el (counsel-find-file-undo): Remap undo, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra fc3252b 274/395: Don't insert ^ on aborting completion in region, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra a4a22e0 294/395: ivy.el (ivy-display-style): Remove, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra ee747e6 290/395: ivy.el (ivy--update-history): Use ivy-state-current for file names, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra f67a2bb 215/395: ivy.el (ivy--filter): Prioritize :matcher, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra ca89b5d 236/395: ivy.el (ivy--recompute-index): Don't call ivy-set-index twice, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra bd80852 251/395: Fix punctuation in some error messages, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 8383dd6 248/395: * counsel.el: Unquote lambda actions, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 6916cbd 256/395: doc/ivy.org: Document ivy-insert-current-full, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra ace2475 260/395: counsel.el (counsel--sync-sentinel-on-exit): Fix regression, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra f1472ef 266/395: ivy.el: When completing files, make "RET" reverse "DEL",
Basil L. Contovounesios <=
- [elpa] externals/ivy-hydra 82cb9da 272/395: ivy.el (ivy--do-shrink-window): Account for the extra prompt height, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 6f50fca 286/395: ivy.el: When reading file names, take the non-directory part of :initial-input, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra d452878 291/395: counsel-grep/ag/rg/pt/...: Allow to deplay subprocess creation, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 84dfbf8 296/395: ivy-avy.el: Checkdoc, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 864570a 323/395: ivy.el (ivy--get-multi-action): Fix and add a test, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 05c12fc 310/395: counsel.el (counsel--grep-smart-case-flag): Check if base command is a string, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra b2af619 322/395: ivy.el (ivy--call-marked): Don't call multi-action if non-default action was chosen, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 683a7b7 309/395: ivy.el (ivy-completion-in-region): Fix "^" and C-g, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra ea9bd06 353/395: Encode --pcre switch correctly for ivy-occur, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 63549da 354/395: Fix counsel-descbinds for Emacs 28, Basil L. Contovounesios, 2021/02/25