Pseudo classes expands with semi-colon #130

Closed
nicooprat opened this Issue Nov 15, 2012 · 5 comments

Projects

None yet

2 participants

@nicooprat

Since Zen Coding became Emmet, when typing a colon (":"), a semi-colon (";") is automatically inserted after the cursor.

But sometimes, we need to write pseudo classes that begins with colon. For example, :hover or :after. Anyway to disable or fine-tune this behavior ? Didn't see anything about it preferences.

Thanks.

@sergeche
Owner

It’s not Emmet, it’s a default CSS bundle:

{ "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.css - meta.selector.css", "match_all": true },
        { "key": "following_text", "operator": "regex_contains", "operand": "^(?:\t| |\\}|$)", "match_all": true }
    ]
}

As context says, you may set "auto_match_enabled": false setting in your user’s preferences to disable this behaviour.

@nicooprat

Indeed it works ! Many thanks.

@nicooprat nicooprat closed this Nov 15, 2012
@nicooprat

Finally I just deleted the code you quoted (found there : Sublime Text 2/Packages/CSS/Default (OSX).sublime-keymap) because I wanna keep auto_match for other characters like brackets or quotes.

I know it's not future-proof though. Is there a way to create a user-clone of this file ? I tried to duplicate it and rename it "User" instead of "Default" but it didn't work.

Thanks.

@sergeche
Owner

No, it’s not possible. AFAIK, the CSS package is not under Package Control so it can be updated only if you update editor.

@nicooprat

Ok, thanks anyway.

@crates crates referenced this issue in danro/LESS-sublime Feb 22, 2013
Closed

Adds unwanted semi colon after pseudo classes #22

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment