Fuco1 / smartparens

Minor mode for Emacs that deals with parens pairs and tries to be smart about it.
GNU General Public License v3.0
1.83k stars 194 forks source link

Show matches of pairs when necessary ? #675

Open Yevgnen opened 7 years ago

Yevgnen commented 7 years ago

Hi,

I have things like

  (sp-with-modes 'matlab-mode
    (sp-local-pair "'" nil :unless '(sp-point-after-word-p) :actions '(insert)))

in my configs.

After that the ' will not be highlight even when has pairs like 'Oh, no.'. But adding navigate to :actions will highlight the single apostrophes. Is there any way to highlight only when there are pairs ? Thanks !

Fuco1 commented 7 years ago

It should work like you describe, so I take it there's some bug in the highlight code. We'll look into it.

Fuco1 commented 7 years ago

This issue, as well as #676 is caused by the fact that the ' in matlab has punctuation class instead of a string quote class. This makes things all sorts of complicated as one can not rely on the string parser to work properly.

I'm not sure I can do much magic from my side of things... this is more an odd design choice in matlab-mode. :(

Fuco1 commented 7 years ago

I tried to evaluate (modify-syntax-entry ?' "\"") in matlab-mode buffer and things seem to work. You might try that as you probably use it more extensivly. If nothing odd happens we can add that as compat to smartparens.

Yevgnen commented 7 years ago

Thanks for you reply. The highlight the single ' still being highlighted here, but the sp-kill-hybrid-sexp seems gone.

Fuco1 commented 7 months ago

note to self: maybe there is some syntax flag for string braces?