diff options
| author | Nathaniel Nicandro <nathanielnicandro@gmail.com> | 2018-08-29 15:03:50 -0500 |
|---|---|---|
| committer | Eivind Fonn <evfonn@gmail.com> | 2018-09-12 11:57:01 +0200 |
| commit | 48f78cc2d769456fa0de9266a6fde279ad720716 (patch) | |
| tree | 7c4d4b5696ac6a0816d871e1819cca40068fdc87 /evil-ex.el | |
| parent | 7ff4a877f3c5cc8765ee81a910c25d70940b486f (diff) | |
Support recursive minibuffers in Ex
When `enable-recursive-minibuffers` is non-nil it is
possible to enter another minibuffer at a lower editing
depth from within the Ex minibuffer.
Since `evil-ex-teardown` is added to the global value of
`minibuffer-exit-hook`, it will only be called in the
minibuffer at the lower level when it exits instead of in
the Ex minibuffer since it is removed from
`minibuffer-exit-hook` when it is called.
But this means that `evil-ex-update` will not be properly
cleaned up since it is added to the local value of
`after-change-functions` in the Ex minibuffer.
After completely exiting all minibuffers and then entering a
minibuffer that is not an Ex minibuffer, `evil-ex-update`
will still be in `after-change-functions` due to how
minibuffers are
named (https://www.gnu.org/software/emacs/manual/html_node/elisp/Intro-to-Minibuffers.html)
and assuming that the initial Ex was entered when the
recursive editing depth was 0.
Instead of adding `evil-ex-teardown` to the global value of
`minibuffer-exit-hook`, this commit adds it to the local
value of `minibuffer-exit-hook` in the Ex minibuffer so that
`evil-ex-update` is properly removed regardless of how many
recursive minibuffers there are.
Diffstat (limited to 'evil-ex.el')
| -rw-r--r-- | evil-ex.el | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -228,7 +228,7 @@ This function registers several hooks that are used for the interactive actions during ex state." (add-hook 'post-command-hook #'evil-ex-abort) (add-hook 'after-change-functions #'evil-ex-update nil t) - (add-hook 'minibuffer-exit-hook #'evil-ex-teardown) + (add-hook 'minibuffer-exit-hook #'evil-ex-teardown nil t) (when evil-ex-previous-command (add-hook 'pre-command-hook #'evil-ex-remove-default)) (remove-hook 'minibuffer-setup-hook #'evil-ex-setup) @@ -248,7 +248,7 @@ interactive actions during ex state." "Deinitialize Ex minibuffer. Clean up everything set up by `evil-ex-setup'." (remove-hook 'post-command-hook #'evil-ex-abort) - (remove-hook 'minibuffer-exit-hook #'evil-ex-teardown) + (remove-hook 'minibuffer-exit-hook #'evil-ex-teardown t) (remove-hook 'after-change-functions #'evil-ex-update t) (when evil-ex-argument-handler (let ((runner (evil-ex-argument-handler-runner |
