smartparens icon indicating copy to clipboard operation
smartparens copied to clipboard

Quick fix for trigger-wrap

Open haji-ali opened this issue 4 years ago • 0 comments

I think the function sp-wrap--can-wrap-p does not treat trigger-wrap correctly because it only checks if the last-command-event is the opening or closing delimiter. This can be fixed as follows for example:

diff --git a/smartparens.el b/smartparens.el
index 88e10da..ddbb633 100644
--- a/smartparens.el
+++ b/smartparens.el
@@ -3399,6 +3399,7 @@ Also added to `self-insert-uses-region-functions' to prevent
   (let* ((list (sp--get-pair-list-wrap))
          (desc (sp--single-key-description last-command-event)))
     (--any? (or (string-prefix-p desc (car it))
+                (string-prefix-p desc (sp-get-pair (car it) :trigger-wrap))
                 (string-prefix-p desc (cdr it)))
             list)))

haji-ali avatar Feb 08 '21 18:02 haji-ali