Sublime Forum

CSS syntax and the semicolon

#1

Hi guys,

Bit of a ST n00b here, but I’ve been trawling Google for hours trying to find a way to prevent the CSS syntax autocomplete-thingy from adding a semicolon.

When I for example write:

body{width:}

it automatically adds a semicolon after the colon, so it ends up saying:

body{width:;}

How can I prevent this semicolon from appearing?

Cheers,
Aarfing

0 Likes

#2

Something like the solution I posted here should work.

0 Likes

#3

Thanks for your anwer, nick, but changing in css_completions.py doesn’t seem to change the behavior I get when not using autocomplete.

When using TAB-completion it seems to work, but when I just write “width:” myself it adds a semicolon.

Actually just typing a colon anywhere in a CSS-file results in an added semicolon - this is the behaviour I’m trying to change.

Any other ideas?

Thanks again

0 Likes

#4

Actually just typing a colon anywhere in a CSS-file results in an added semicolon - this is the behaviour I’m trying to change.

Out of curiosity: why?

0 Likes

#5

Because of pseudo-elements/classes etc.

It’s a pain to have to remove the colon constantly.

0 Likes