summaryrefslogtreecommitdiff
path: root/evil-surround.el
diff options
context:
space:
mode:
authortam5 <arimiller92@gmail.com>2018-12-15 21:38:29 -0500
committertam5 <arimiller92@gmail.com>2018-12-16 14:07:31 -0500
commit1a4bc20f158aa9f4e4811a6363cc65ea24f167ce (patch)
treed77563753755500573b10ca1c520b94b73f90bd5 /evil-surround.el
parent897203ca5fce1c6cc33bf0ee4ef2a7e211063b02 (diff)
add csw, csW, css and csp shortcuts1.0.3
Diffstat (limited to 'evil-surround.el')
-rw-r--r--evil-surround.el10
1 files changed, 9 insertions, 1 deletions
diff --git a/evil-surround.el b/evil-surround.el
index 854c42f..383c0fd 100644
--- a/evil-surround.el
+++ b/evil-surround.el
@@ -137,6 +137,13 @@ Each item is of the form (OPERATOR . OPERATION)."
"Returns whether CHAR is a valid surround char or not."
(not (memq char '(?\C-\[ ?\C-?))))
+(defun evil-surround-delete-char-noop-p (char)
+ "Returns whether CHAR is a noop when used with surround delete."
+ (memq char (list (string-to-char "w")
+ (string-to-char "W")
+ (string-to-char "s")
+ (string-to-char "p"))))
+
(defun evil-surround-pair (char)
"Return the evil-surround pair of char.
This is a cons cell (LEFT . RIGHT), both strings."
@@ -232,7 +239,8 @@ overlays OUTER and INNER, which are passed to `evil-surround-delete'."
(interactive (evil-surround-input-char))
(cond
((and outer inner)
- (evil-surround-delete char outer inner)
+ (unless (evil-surround-delete-char-noop-p char)
+ (evil-surround-delete char outer inner))
(let ((key (evil-surround-read-char)))
(evil-surround-region (overlay-start outer)
(overlay-end outer)