[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/evil 3232f9413f 1/2: Add `evil-want-empty-ex-last-command`
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/evil 3232f9413f 1/2: Add `evil-want-empty-ex-last-command` to vars |
Date: |
Fri, 7 Jan 2022 11:58:16 -0500 (EST) |
branch: elpa/evil
commit 3232f9413f1bc0b4155fa20aaa8649d0f0c505d7
Author: Tom Dalziel <tom_dl@hotmail.com>
Commit: Tom Dalziel <33435574+tomdl89@users.noreply.github.com>
Add `evil-want-empty-ex-last-command` to vars
fixes #883
---
evil-ex.el | 7 +++++--
evil-vars.el | 5 +++++
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/evil-ex.el b/evil-ex.el
index 488fc2034e..4ee28b8495 100644
--- a/evil-ex.el
+++ b/evil-ex.el
@@ -192,18 +192,21 @@ is appended to the line."
":"
(or initial-input
(and evil-ex-previous-command
+ evil-want-empty-ex-last-command
(propertize evil-ex-previous-command 'face 'shadow)))
evil-ex-completion-map
nil
'evil-ex-history
- evil-ex-previous-command
+ (when evil-want-empty-ex-last-command
+ evil-ex-previous-command)
t)))
(evil-ex-execute result)))
(defun evil-ex-execute (result)
"Execute RESULT as an ex command on `evil-ex-current-buffer'."
;; empty input means repeating the previous command
- (when (zerop (length result))
+ (when (and (zerop (length result))
+ evil-want-empty-ex-last-command)
(setq result evil-ex-previous-command))
;; parse data
(evil-ex-update nil nil nil result)
diff --git a/evil-vars.el b/evil-vars.el
index 3887bb45f5..e4eded64c8 100644
--- a/evil-vars.el
+++ b/evil-vars.el
@@ -1943,6 +1943,11 @@ Otherwise the previous command is assumed as
substitute.")
(define-key evil-ex-search-keymap [escape] 'abort-recursive-edit)
(set-keymap-parent evil-ex-search-keymap minibuffer-local-map)
+(defcustom evil-want-empty-ex-last-command t
+ "Whether to default to evil-ex-previous-command at empty ex prompt."
+ :type 'boolean
+ :group 'evil)
+
(defconst evil-version
(eval-when-compile
(with-temp-buffer