Fix #2293: easymotion with evil operators

Reverts fix for #1672, but provides a workaround:

  (map! :n "gl" (λ! (+evil/easymotion 'normal 'global)))
This commit is contained in:
Henrik Lissner 2020-01-28 17:50:11 -05:00
parent c7ab4fafc6
commit fe0c5e135d
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 16 additions and 10 deletions

View file

@ -93,13 +93,20 @@ the only window, use evil-window-move-* (e.g. `evil-window-move-far-left')."
(interactive) (+evil--window-swap 'down)) (interactive) (+evil--window-swap 'down))
;;;###autoload ;;;###autoload
(defun +evil/easymotion () (defun +evil/easymotion (&optional state keymap)
"Invoke and lazy-load `evil-easymotion' without compromising which-key "Invoke `evil-easymotion' lazily without compromising which-key integration."
integration." (interactive (list 'motion 'global))
(interactive) (let ((prefix (this-command-keys)))
(require 'evil-easymotion) (require 'evil-easymotion)
(setq prefix-arg current-prefix-arg) (evil-define-key* state keymap prefix evilem-map)
(push '(t . easymotion) unread-command-events)) (setq prefix-arg current-prefix-arg
unread-command-events
(mapcar (lambda (e) (cons t e))
(vconcat (when evil-this-operator
(where-is-internal evil-this-operator
nil
t))
prefix)))))
;;;###autoload (autoload '+evil:apply-macro "editor/evil/autoload/evil" nil t) ;;;###autoload (autoload '+evil:apply-macro "editor/evil/autoload/evil" nil t)
(evil-define-operator +evil:apply-macro (beg end) (evil-define-operator +evil:apply-macro (beg end)

View file

@ -206,7 +206,6 @@ directives. By default, this only recognizes C directives.")
(use-package! evil-easymotion (use-package! evil-easymotion
:commands evilem-create evilem-default-keybindings :commands evilem-create evilem-default-keybindings
:config :config
(evilem-default-keybindings "<easymotion>")
;; Use evil-search backend, instead of isearch ;; Use evil-search backend, instead of isearch
(evilem-make-motion evilem-motion-search-next #'evil-ex-search-next (evilem-make-motion evilem-motion-search-next #'evil-ex-search-next
:bind ((evil-ex-search-highlight-all nil))) :bind ((evil-ex-search-highlight-all nil)))
@ -552,9 +551,9 @@ To change these keys see `+evil-repeat-keys'."
:textobj "k" #'evil-indent-plus-i-indent-up #'evil-indent-plus-a-indent-up :textobj "k" #'evil-indent-plus-i-indent-up #'evil-indent-plus-a-indent-up
:textobj "x" #'evil-inner-xml-attr #'evil-outer-xml-attr :textobj "x" #'evil-inner-xml-attr #'evil-outer-xml-attr
;; evil-easymotion ;; evil-easymotion (see `+evil/easymotion')
(:after evil-easymotion (:after evil-easymotion
(:prefix "<easymotion>" ; see `+evil/easymotion' (:map evilem-map
"a" (evilem-create #'evil-forward-arg) "a" (evilem-create #'evil-forward-arg)
"A" (evilem-create #'evil-backward-arg) "A" (evilem-create #'evil-backward-arg)
"s" #'evil-avy-goto-char-2 "s" #'evil-avy-goto-char-2