aboutsummaryrefslogtreecommitdiff
path: root/evil-ex.el
diff options
context:
space:
mode:
Diffstat (limited to 'evil-ex.el')
-rw-r--r--evil-ex.el18
1 files changed, 18 insertions, 0 deletions
diff --git a/evil-ex.el b/evil-ex.el
index ecb4175..26feeb4 100644
--- a/evil-ex.el
+++ b/evil-ex.el
@@ -222,6 +222,24 @@ Otherwise behaves like `delete-backward-char'."
(unless (minibufferp)
(abort-recursive-edit)))
+(defun evil-ex-command-window ()
+ "Start command window with ex history and current minibuffer content."
+ (interactive)
+ (let ((current (minibuffer-contents))
+ (config (current-window-configuration)))
+ (evil-ex-teardown)
+ (select-window (minibuffer-selected-window) t)
+ (evil-command-window (cons current evil-ex-history)
+ ":"
+ (apply-partially 'evil-ex-command-window-execute config))))
+
+(defun evil-ex-command-window-execute (config result)
+ (select-window (active-minibuffer-window) t)
+ (set-window-configuration config)
+ (delete-minibuffer-contents)
+ (insert result)
+ (exit-minibuffer))
+
(defun evil-ex-setup ()
"Initialize Ex minibuffer.
This function registers several hooks that are used for the