Merge pull request #4414 from nbfalcon/bugfix/evil-ex-smartparens

Enable `smartparens' for `evil'
This commit is contained in:
Henrik Lissner 2020-12-12 13:03:31 -05:00 committed by GitHub
commit 6f5cde1386
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -505,10 +505,19 @@ files, so we replace calls to `pp' with the much faster `prin1'."
(setf (alist-get key sp-message-alist) nil))
(add-hook! 'eval-expression-minibuffer-setup-hook
(defun doom-init-smartparens-in-minibuffer-maybe-h ()
(defun doom-init-smartparens-in-eval-expression-h ()
"Enable `smartparens-mode' in the minibuffer for `eval-expression'.
Only enable it if `smartparens-global-mode' is on."
(when smartparens-global-mode (smartparens-mode))))
This includes everything that calls `read--expression', e.g.
`edebug-eval-expression' Only enable it if
`smartparens-global-mode' is on."
(when smartparens-global-mode (smartparens-mode +1))))
(add-hook! 'minibuffer-setup-hook
(defun doom-init-smartparens-in-minibuffer-maybe-h ()
"Enable `smartparens' for non-`eval-expression' commands.
Only enable `smartparens-mode' if `smartparens-global-mode' is
on."
(when (and smartparens-global-mode (memq this-command '(evil-ex)))
(smartparens-mode +1))))
;; You're likely writing lisp in the minibuffer, therefore, disable these
;; quote pairs, which lisps doesn't use for strings: