Sublime Forum

ST4 won't create double spaces in a class in SCSS files

#1

Little annoying bug when creating a class only in SCSS files. CSS files are not affected: When I create a space to write the first property, it supposed to create 2 spaces. In SCSS files, only one is created. Gif of the bug:

Peek%202021-06-01%2012-58

0 Likes

#2

Same like the previous one you opened. CSS package has a key binding to do it.

Here is the modified key binding that works for sass files (again changing the selector context)

// Expand {|} to { | } when space is pressed
    { "keys": [" "], "command": "insert_snippet", "args": {"contents": " $0 "}, "context":
        [
            { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
            { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
            { "key": "selector", "operator": "equal", "operand": "source.scss - meta.selector.css", "match_all": true },
            { "key": "preceding_text", "operator": "regex_contains", "operand": "\\{$", "match_all": true },
            { "key": "following_text", "operator": "regex_contains", "operand": "^\\}", "match_all": true }
        ]
    },
2 Likes

#3

Ok my bad. Tought was a bug because ST3 is not affected by this behavior, and it was also different between .css and .scss files. All fixed.

0 Likes