From dc0b538b358511c7c6bfdea4d4af337c7dbcb865 Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Wed, 22 Dec 2010 04:48:23 -0500 Subject: [PATCH] Fix CSS completion. --- common/modules/styles.jsm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/modules/styles.jsm b/common/modules/styles.jsm index a24a0702..ee523e4c 100644 --- a/common/modules/styles.jsm +++ b/common/modules/styles.jsm @@ -311,9 +311,9 @@ const Styles = Module("Styles", { propertyIter: function (str, always) { this.propertyPattern.lastIndex = 0; - let match; + let match, i = 0; while ((!match || match[0]) && (match = Styles.propertyPattern.exec(str))) - if (always || match[0]) + if (always && !i++ || match[0]) yield this.Property.fromArray(match); }, @@ -514,7 +514,7 @@ const Styles = Module("Styles", { var lastMatch = match; if (lastMatch != null && !lastMatch.value && !lastMatch.postSpace) { - context.advance(lastMatch.index + lastMatch.name.length) + context.advance(lastMatch.index + lastMatch.preSpace.length) context.completions = names; } };