Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Commit 163dc24

Browse files
committed
Merge pull request #3548 from adobe/rlim/cssutils-issue-3448
Always check for a property name from next cursor position if current token is not one of them
2 parents 77c8a7b + 3bdf193 commit 163dc24

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/language/CSSUtils.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -357,16 +357,16 @@ define(function (require, exports, module) {
357357
}
358358

359359
if (_isInPropName(ctx)) {
360-
if (ctx.token.string.length > 0 && !ctx.token.string.match(/\S/)) {
360+
if (ctx.token.className === "property" || ctx.token.className === "property error" || ctx.token.className === "tag") {
361+
propName = ctx.token.string;
362+
} else {
361363
var testPos = {ch: ctx.pos.ch + 1, line: ctx.pos.line},
362364
testToken = editor._codeMirror.getTokenAt(testPos);
363365

364366
if (testToken.className === "property" || testToken.className === "property error" || testToken.className === "tag") {
365367
propName = testToken.string;
366368
offset = 0;
367369
}
368-
} else if (ctx.token.className === "property" || ctx.token.className === "property error" || ctx.token.className === "tag") {
369-
propName = ctx.token.string;
370370
}
371371

372372
// If we're in property name context but not in an existing property name,

0 commit comments

Comments
 (0)