SublimeText / Sass

Sass and SCSS syntax for Sublime Text
https://packagecontrol.io/packages/Sass
MIT License
50 stars 8 forks source link

Sass package no longer respects "word_separators" setting #105

Closed mathijsprovoost closed 5 months ago

mathijsprovoost commented 5 months ago

As of Sass v4.0.0 doubleclicking a CSS declaration in a scss file selects the whole word instead of the part in between the characters that are defined in the "word_separators" setting.

It's set to the default: // Characters that are considered to separate words "word_separators": "./()"'-:,.;<>!@#$%^&*|+=[]{}`?", package.control.log

deathaxe commented 5 months ago

Sass's word separators follow CSS word separator specifications (see https://www.w3.org/TR/selectors-3/#lex), as core CSS package has been doing since ST4130+ (https://github.com/sublimehq/Packages/pull/3287).

In detail it means - is normal part of an CSS identifier and thus was moved from word_separators to sub_word_separators via syntax specific settings.

see: https://github.com/SublimeText/Sass/blob/e390c842b09eb9d436cdfc18ad692733dbeb5450/Syntaxes/SCSS.sublime-settings#L10-L13

related core issues:

It is working as expected.

mathijsprovoost commented 5 months ago

Specifying "sub_wordseparators": "-", in my settings doesn't resolve the issue. I resolved the problem by uninstalling Sass v4 and manually installing v3.0.1

deathaxe commented 5 months ago

Double-clicking select words, but not sub-words, thus selecting everything including - as those ar normal part of an identifier.

Listed settings above are the syntax specific defaults for CSS/Less/Sass/SCSS.

If you want the old behavior - instead of reverting to an older version with other bugs - a more suitable solution was to adjust syntax specific user settings.

  1. Open a SCSS file
  2. Open Command Palette
  3. Call Preferences: Settings - Syntax Specific
  4. On the right window, paste... (from Default/Default.sublime-settings)

    "word_separators": "./\\()\"'-:,.;<>~!@#$%^&*|+=[]{}`~?",   
    "sub_word_separators": "_",

    ... to add - back to word separators.