mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-20 22:47:59 +01:00
Bloody hell.
This commit is contained in:
@@ -781,10 +781,16 @@ var Hints = Module("hints", {
|
|||||||
* @optional
|
* @optional
|
||||||
*/
|
*/
|
||||||
addMode: function (mode, prompt, action, filter, tags) {
|
addMode: function (mode, prompt, action, filter, tags) {
|
||||||
|
function toString(regexp) RegExp.prototype.toString.call(regexp);
|
||||||
|
|
||||||
if (tags != null) {
|
if (tags != null) {
|
||||||
let eht = options.get("extendedhinttags");
|
let eht = options.get("extendedhinttags");
|
||||||
let update = eht.isDefault;
|
let update = eht.isDefault;
|
||||||
eht.stringDefaultValue += "," + Option.quote(util.regexp.escape(mode)) + ":" + tags.map(Option.quote);
|
|
||||||
|
let value = eht.parse(Option.quote(util.regexp.escape(mode)) + ":" + tags.map(Option.quote))[0];
|
||||||
|
eht.defaultValue = eht.defaultValue.filter(function (re) toString(re) != toString(value))
|
||||||
|
.concat(value);
|
||||||
|
|
||||||
if (update)
|
if (update)
|
||||||
eht.reset();
|
eht.reset();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user