Fix evil-embrace race condition at startup #345

The previous config would wait for evil-surround to load before adding
evil-embrace's hooks.
This commit is contained in:
Henrik Lissner 2019-02-28 18:26:13 -05:00
parent ad837e6d13
commit 5f5874c1fc
No known key found for this signature in database
GPG Key ID: 5F6C0EA160557395

View File

@ -186,7 +186,6 @@ line with a linewise comment.")
(def-package! evil-embrace
:after evil-surround
:commands (embrace-add-pair embrace-add-pair-regexp)
:hook (LaTeX-mode . embrace-LaTeX-mode-hook)
:hook (org-mode . embrace-org-mode-hook)
@ -198,9 +197,10 @@ line with a linewise comment.")
(embrace-add-pair-regexp ?f "([^ ]+ " ")" #'+evil--embrace-elisp-fn))
(add-hook! (org-mode LaTeX-mode)
(embrace-add-pair-regexp ?l "\\[a-z]+{" "}" #'+evil--embrace-latex))
(after! evil-surround
(evil-embrace-enable-evil-surround-integration))
:config
(setq evil-embrace-show-help-p nil)
(evil-embrace-enable-evil-surround-integration)
(defun +evil--embrace-get-pair (char)
(if-let* ((pair (cdr-safe (assoc (string-to-char char) evil-surround-pairs-alist))))