From 5cb5ef1e03c2450ccbd34498757d01e5391741c3 Mon Sep 17 00:00:00 2001 From: James Nguyen Date: Tue, 28 Nov 2017 21:39:31 -0800 Subject: Cider: Don't advise if evil-move-beyond-eol is true --- evil-cider.el | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/evil-cider.el b/evil-cider.el index fa79ccb..4423136 100644 --- a/evil-cider.el +++ b/evil-cider.el @@ -41,11 +41,12 @@ (defun evil-cider-setup () "Set up `evil' bindings for `cider'." - (advice-add 'cider-eval-last-sexp :around 'evil-cider-last-sexp) - (advice-add 'cider-eval-last-sexp-and-replace :around 'evil-cider-last-sexp) - (advice-add 'cider-eval-last-sexp-to-repl :around 'evil-cider-last-sexp) - (with-eval-after-load 'cider-eval-sexp-fu - (advice-add 'cider-esf--bounds-of-last-sexp :around 'evil-cider-last-sexp)) + (unless evil-move-beyond-eol + (advice-add 'cider-eval-last-sexp :around 'evil-cider-last-sexp) + (advice-add 'cider-eval-last-sexp-and-replace :around 'evil-cider-last-sexp) + (advice-add 'cider-eval-last-sexp-to-repl :around 'evil-cider-last-sexp) + (with-eval-after-load 'cider-eval-sexp-fu + (advice-add 'cider-esf--bounds-of-last-sexp :around 'evil-cider-last-sexp))) (evil-define-key '(normal visual) cider-mode-map "gd" 'cider-find-var -- cgit v1.0