I use the TextMate 2 SCSS bundle everyday.
It has a very annoying behavior: it "autocompletes" some stuff using the "Smart Typing Pairs" feature.
It's very useful most of the time (e.g. I type (
and it types )
automatically), but buy looking at the source code you can see there's a not-so-intuitive autocompletion:
<string>:</string>
<string>;</string>
Ok, when I type: background:
it turns it into background:;
, and that's ok, but it also turns a:not(:last-child)
into the incredibly annoying a:not(:last-child);;
, which I have to clean every single time.
Now, since the TextMate manual is very brief when it mentions Smart Typing Pairs (here), I would like to know how to solve this issue.
For example, can I use regexes to choose what to smart-complete? Or what to exclude?
Paraphrasing Alan the lead developer from the mailing list:
For CSS this is the PropertyName setting in Bundles → CSS → Settings. Currently it is scoped to ‘meta.property-list.css -meta.property-value’ which should limit where it fires.
Looking in [the SCSS bundle], it there is a Smart Typing Pairs setting with the pair which is scoped to source.css. This appears to be wrong, and it should instead mimic the CSS bundle wrt. only enabling it in the context where it makes sense.
To do that, just set your Bundle Editor
→ SCSS
→ Settings
→ Smart Typing Pairs
→ Scope Selector
to
meta.property-list.scss -meta.property-value