From bd98f7f5492446885dc4c6b0a7579c75c22ac829 Mon Sep 17 00:00:00 2001 From: Tom Dalziel Date: Sun, 17 Sep 2023 17:41:34 +0200 Subject: Return an empty range from evil-surround-edit This fixes a bug with evil-cleverparens where evil-cp-delete tries to call evil-delete with the range, deleting too much text if the point isn't on the opening paren. --- evil-surround.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/evil-surround.el b/evil-surround.el index aa7348f..b68329d 100644 --- a/evil-surround.el +++ b/evil-surround.el @@ -407,7 +407,9 @@ Otherwise call `evil-surround-region'." (call-interactively 'evil-surround-delete)) (t (evil-surround-setup-surround-line-operators) - (evil-surround-call-with-repeat 'evil-surround-region)))) + (evil-surround-call-with-repeat 'evil-surround-region))) + ;; Return an empty range so evil-motion-range doesn't try to guess + (let ((p (point))) (list p p 'exclusive))) (evil-define-command evil-Surround-edit (operation) "Like evil-surround-edit, but for surrounding with additional new-lines. -- cgit v1.0