diff options
author | Kris Maglione <maglione.k@gmail.com> | 2010-12-22 04:48:23 -0500 |
---|---|---|
committer | Kris Maglione <maglione.k@gmail.com> | 2010-12-22 04:48:23 -0500 |
commit | dc0b538b358511c7c6bfdea4d4af337c7dbcb865 (patch) | |
tree | b80968c015751e8533864a3edafcc247ed67bc95 /common/modules | |
parent | 9a1d78ee56dfb6ce154f2607cc240d5c9175dc8c (diff) | |
download | pentadactyl-dc0b538b358511c7c6bfdea4d4af337c7dbcb865.tar.gz |
Fix CSS completion.
Diffstat (limited to 'common/modules')
-rw-r--r-- | common/modules/styles.jsm | 6 |
1 files 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; } }; |