1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-29 17:35:46 +01:00

Allow \c/\C in regexp options and so forth.

This commit is contained in:
Kris Maglione
2011-03-02 14:43:57 -05:00
parent 0f542bc000
commit 66785a8b5f
9 changed files with 45 additions and 25 deletions

View File

@@ -1276,7 +1276,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
let urls;
if (options["urlseparator"])
urls = util.splitLiteral(str, RegExp("\\s*" + options["urlseparator"] + "\\s*"));
urls = util.splitLiteral(str, util.regexp("\\s*" + options["urlseparator"] + "\\s*"));
else
urls = [str];

View File

@@ -300,6 +300,8 @@ var EventHive = Class("EventHive", Contexts.Hive, {
* @param {function} callback The function to call when the event is received.
* @param {boolean} capture When true, listen during the capture
* phase, otherwise during the bubbling phase.
* @param {boolean} allowUntrusted When true, allow capturing of
* untrusted events.
*/
listen: function (target, event, callback, capture, allowUntrusted) {
if (!isObject(event))
@@ -821,9 +823,7 @@ var Events = Module("events", {
unknownOk = true;
let out = [];
let re = RegExp("<.*?>?>|[^<]|<(?!.*>)", "g");
let match;
while ((match = re.exec(input))) {
for (let match in util.regexp.iterate(/<.*?>?>|[^<]|<(?!.*>)/g, input)) {
let evt_str = match[0];
let evt_obj = { ctrlKey: false, shiftKey: false, altKey: false, metaKey: false,
keyCode: 0, charCode: 0, type: "keypress" };

View File

@@ -847,8 +847,8 @@ var Hints = Module("hints", {
* hints that match as above.
*/
function wordStartsWithMatcher(hintString, allowWordOverleaping) { //{{{
let hintStrings = tokenize(/\s+/, hintString);
let wordSplitRegexp = RegExp(options["wordseparators"]);
let hintStrings = tokenize(/\s+/, hintString);
let wordSplitRegexp = util.regexp(options["wordseparators"]);
/**
* Match a set of characters to the start of words.