You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my config I have a lot of weird parenthesis types defined, and sp-forward-slurp-sexp seems to work fine with all of them but one. Here is an example:
In an otherwise unconfigured emacs, evaluate:
(require 'smartparens)
(sp-pair "«" "»")
Then put this text in your buffer:
«fo|o»«bar»
where | represents the cursor position. Then type M-x sp-forward-slurp-sexp and you get this:
«foo bar»»«
when I'm expecting this:
«foo «bar»»
sp-backwards-slup seems to work fine, and barfing both directions seems fine.
The text was updated successfully, but these errors were encountered:
Huh, this is odd but I think I know why it happens. The character << has a "sticky" syntax type and so the closing paren of the first expression drags it along. Imagine }; in something like C or Java, you usually want to drag the semicolon around.
So this is a "misconfiguration", but it's simple to fix, look at sp-sexp-suffix.
I'm trying to come up with some better setting, but given that it is quite random how emacs assigns the syntax it doesn't always work.
In your case however, it should just figure it out automatically as the thing it drags along is actually a vaild pair opening, and that should obviously never happen. So I'm marking this a bug and you can, in the mean time, fix it by using the above setting.
In my config I have a lot of weird parenthesis types defined, and sp-forward-slurp-sexp seems to work fine with all of them but one. Here is an example:
In an otherwise unconfigured emacs, evaluate:
Then put this text in your buffer:
where | represents the cursor position. Then type
M-x sp-forward-slurp-sexp
and you get this:when I'm expecting this:
sp-backwards-slup seems to work fine, and barfing both directions seems fine.
The text was updated successfully, but these errors were encountered: