1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-23 11:58:00 +01:00

use \S rather than a negated \s character set in patterns

This commit is contained in:
Doug Kearns
2008-10-04 03:14:04 +00:00
parent 7b324a05b1
commit 3ceecbaf52
5 changed files with 7 additions and 7 deletions

View File

@@ -664,7 +664,7 @@ liberator.Buffer = function () //{{{
"Add or list user styles", "Add or list user styles",
function (args, special) function (args, special)
{ {
let [, filter, css] = args.match(/([^\s]+)\s*((?:.|\n)*)/) || []; let [, filter, css] = args.match(/(\S+)\s*((?:.|\n)*)/) || [];
if (!css) if (!css)
{ {
let str = liberator.template.tabular(["", "Filter", "CSS"], let str = liberator.template.tabular(["", "Filter", "CSS"],
@@ -1832,8 +1832,8 @@ liberator.Marks = function () //{{{
let list = liberator.template.tabular(["mark", "line", "col", "file"], let list = liberator.template.tabular(["mark", "line", "col", "file"],
["", "text-align: right", "text-align: right", "color: green"], ["", "text-align: right", "text-align: right", "color: green"],
([mark[0], ([mark[0],
Math.round(mark[1].position.x & 100) + "%", Math.round(mark[1].position.x & 100) + "%",
Math.round(mark[1].position.y & 100) + "%", Math.round(mark[1].position.y & 100) + "%",
mark[1].location] mark[1].location]
for each (mark in marks))); for each (mark in marks)));
liberator.commandline.echo(list, liberator.commandline.HL_NORMAL, liberator.commandline.FORCE_MULTILINE); liberator.commandline.echo(list, liberator.commandline.HL_NORMAL, liberator.commandline.FORCE_MULTILINE);

View File

@@ -103,7 +103,7 @@ liberator.Command.prototype = {
} }
else if (this.hereDoc) else if (this.hereDoc)
{ {
let matches = args.match(/(.*)<<\s*([^\s]+)$/); let matches = args.match(/(.*)<<\s*(\S+)$/);
if (matches && matches[2]) if (matches && matches[2])
{ {
liberator.commandline.inputMultiline(new RegExp("^" + matches[2] + "$", "m"), liberator.commandline.inputMultiline(new RegExp("^" + matches[2] + "$", "m"),

View File

@@ -164,7 +164,7 @@ liberator.Editor = function () //{{{
return; return;
} }
var matches = args.match(/^([^\s]+)(?:\s+(.+))?$/); var matches = args.match(/^(\S+)(?:\s+(.+))?$/);
var [lhs, rhs] = [matches[1], matches[2]]; var [lhs, rhs] = [matches[1], matches[2]];
if (rhs) if (rhs)
liberator.editor.addAbbreviation(mode, lhs, rhs); liberator.editor.addAbbreviation(mode, lhs, rhs);

View File

@@ -666,7 +666,7 @@ liberator.Events = function () //{{{
function (args) function (args)
{ {
XML.prettyPrinting = false; XML.prettyPrinting = false;
var str = liberator.template.tabular(["Macro", "Keys"], [], liberator.events.getMacros(args)); var str = liberator.template.tabular(["Macro", "Keys"], [], liberator.events.getMacros(args));
liberator.echo(str, liberator.commandline.FORCE_MULTILINE); liberator.echo(str, liberator.commandline.FORCE_MULTILINE);
}, },
{ {

View File

@@ -824,7 +824,7 @@ lookup:
else if (command.name == "javascript") else if (command.name == "javascript")
{ {
// check for a heredoc // check for a heredoc
let matches = args.match(/(.*)<<\s*([^\s]+)$/); let matches = args.match(/(.*)<<\s*(\S+)$/);
if (matches) if (matches)
{ {