smartparens icon indicating copy to clipboard operation
smartparens copied to clipboard

Show matches of pairs when necessary ?

Open Yevgnen opened this issue 9 years ago • 5 comments

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 !

Yevgnen avatar Nov 18 '16 01:11 Yevgnen

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

Fuco1 avatar Nov 18 '16 10:11 Fuco1

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 avatar Nov 21 '16 10:11 Fuco1

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.

Fuco1 avatar Nov 21 '16 10:11 Fuco1

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

Yevgnen avatar Nov 21 '16 11:11 Yevgnen

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

Fuco1 avatar Apr 03 '24 15:04 Fuco1