mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-02-19 16:35:49 +01:00
Fix CSS completion.
This commit is contained in:
@@ -311,9 +311,9 @@ const Styles = Module("Styles", {
|
|||||||
propertyIter: function (str, always) {
|
propertyIter: function (str, always) {
|
||||||
this.propertyPattern.lastIndex = 0;
|
this.propertyPattern.lastIndex = 0;
|
||||||
|
|
||||||
let match;
|
let match, i = 0;
|
||||||
while ((!match || match[0]) && (match = Styles.propertyPattern.exec(str)))
|
while ((!match || match[0]) && (match = Styles.propertyPattern.exec(str)))
|
||||||
if (always || match[0])
|
if (always && !i++ || match[0])
|
||||||
yield this.Property.fromArray(match);
|
yield this.Property.fromArray(match);
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -514,7 +514,7 @@ const Styles = Module("Styles", {
|
|||||||
var lastMatch = match;
|
var lastMatch = match;
|
||||||
|
|
||||||
if (lastMatch != null && !lastMatch.value && !lastMatch.postSpace) {
|
if (lastMatch != null && !lastMatch.value && !lastMatch.postSpace) {
|
||||||
context.advance(lastMatch.index + lastMatch.name.length)
|
context.advance(lastMatch.index + lastMatch.preSpace.length)
|
||||||
context.completions = names;
|
context.completions = names;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user