[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/evil-surround b11048d92a 173/175: Trim whitespace from del
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/evil-surround b11048d92a 173/175: Trim whitespace from delimeters before using for deletion/change |
Date: |
Mon, 9 Oct 2023 13:01:17 -0400 (EDT) |
branch: elpa/evil-surround
commit b11048d92aa253d59097a82398e142453c809692
Author: Tom Dalziel <tom_dl@hotmail.com>
Commit: Tom Dalziel <tom_dl@hotmail.com>
Trim whitespace from delimeters before using for deletion/change
Fixes #204
---
evil-surround.el | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/evil-surround.el b/evil-surround.el
index c46abd57be..6a47d1f30b 100644
--- a/evil-surround.el
+++ b/evil-surround.el
@@ -289,6 +289,12 @@ This overlay excludes the delimeters."
(evil-expand-range range)
range)))
+(defun evil-surround--get-delims (char)
+ "Given a CHAR, return delims from the pairs alist. Trim whitespace."
+ (cl-destructuring-bind (&optional k . (o . c)) (assoc char
evil-surround-pairs-alist)
+ (when k
+ (cons (string-trim o) (string-trim c)))))
+
;;;###autoload
(defun evil-surround-delete (char &optional outer inner)
"Delete the surrounding delimiters represented by CHAR.
@@ -306,7 +312,7 @@ between these overlays is what is deleted."
(t
;; no overlays specified: create them on the basis of CHAR
;; and delete after use
- (let* ((delims (cdr (assoc char evil-surround-pairs-alist)))
+ (let* ((delims (evil-surround--get-delims char))
(outer (evil-surround-outer-overlay delims char))
(inner (evil-surround-inner-overlay delims char)))
(unwind-protect
@@ -330,7 +336,7 @@ overlays OUTER and INNER, which are passed to
`evil-surround-delete'."
(overlay-end outer)
nil (if (evil-surround-valid-char-p key) key
char))))
(t
- (let* ((delims (cdr (assoc char evil-surround-pairs-alist)))
+ (let* ((delims (evil-surround--get-delims char))
(outer (evil-surround-outer-overlay delims char))
(inner (evil-surround-inner-overlay delims char)))
(unwind-protect
- [nongnu] elpa/evil-surround 757ddb93c7 122/175: add tests for @jusbur's pull #130 which fixes #125, (continued)
- [nongnu] elpa/evil-surround 757ddb93c7 122/175: add tests for @jusbur's pull #130 which fixes #125, ELPA Syncer, 2023/10/09
- [nongnu] elpa/evil-surround a14856cd81 157/175: Bump version to 1.0.4, ELPA Syncer, 2023/10/09
- [nongnu] elpa/evil-surround 5a20c9757e 126/175: surround-function improvement for lisp modes (#134), ELPA Syncer, 2023/10/09
- [nongnu] elpa/evil-surround 62255a9901 123/175: Fix regression for Emacs 26 caused by #125 fix, ELPA Syncer, 2023/10/09
- [nongnu] elpa/evil-surround 6e1da767ec 125/175: try same layout layout as evil, ELPA Syncer, 2023/10/09
- [nongnu] elpa/evil-surround 63ce018488 132/175: add license file, ELPA Syncer, 2023/10/09
- [nongnu] elpa/evil-surround 2d878b6cce 166/175: Enable lexical binding, ELPA Syncer, 2023/10/09
- [nongnu] elpa/evil-surround 6028c76399 131/175: readme: add missing link to `define-and-bind-text-object` macro, ELPA Syncer, 2023/10/09
- [nongnu] elpa/evil-surround 83c2e0f369 137/175: add a "make emacs" makefile option to fire up a clean emacs..., ELPA Syncer, 2023/10/09
- [nongnu] elpa/evil-surround 440d391c89 130/175: Fix visible narrowing when surrounding within a field (#135), ELPA Syncer, 2023/10/09
- [nongnu] elpa/evil-surround b11048d92a 173/175: Trim whitespace from delimeters before using for deletion/change,
ELPA Syncer <=
- [nongnu] elpa/evil-surround 4d6cc94df0 146/175: Add surround text objects from local keymap (#165), ELPA Syncer, 2023/10/09
- [nongnu] elpa/evil-surround 282a975bda 154/175: Typo fix, ELPA Syncer, 2023/10/09
- [nongnu] elpa/evil-surround a3803cfb51 141/175: Add a test for surrounding with a tag in a macro, ELPA Syncer, 2023/10/09
- [nongnu] elpa/evil-surround 6d37e5c910 115/175: add melpa stable badge, ELPA Syncer, 2023/10/09
- [nongnu] elpa/evil-surround f273821f57 165/175: Merge pull request #188 from skangas/nongnu-elpa-fixes, ELPA Syncer, 2023/10/09
- [nongnu] elpa/evil-surround 2bc8aa6425 160/175: Merge pull request #186 from leungbk/prefix-calls, ELPA Syncer, 2023/10/09
- [nongnu] elpa/evil-surround 4a21d756b7 168/175: Revert "Enable lexical binding", ELPA Syncer, 2023/10/09
- [nongnu] elpa/evil-surround a3034c284d 049/175: Fix surrounding with invalid chars, like ESC (Fix #51), ELPA Syncer, 2023/10/09
- [nongnu] elpa/evil-surround 27eb4112db 050/175: Merge pull request #53 from hlissner/block-surround, ELPA Syncer, 2023/10/09
- [nongnu] elpa/evil-surround 71f380b6b6 042/175: Merge pull request #35 from Silex/master, ELPA Syncer, 2023/10/09