mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-23 17:12:28 +01:00
added 2 scripts, and :%foo support
This commit is contained in:
1
AUTHORS
1
AUTHORS
@@ -12,6 +12,7 @@ Inactive/former developers:
|
||||
* Viktor Kojouharov (Виктор Кожухаров)
|
||||
|
||||
Patches (in no special order):
|
||||
* Konstantin Stepanov (:%foo support)
|
||||
* Lukas Mai
|
||||
* Guido Van Hoecke
|
||||
* Daniel Trstenjak (various things with hints)
|
||||
|
||||
1
NEWS
1
NEWS
@@ -8,6 +8,7 @@
|
||||
generous donation which made this behavior possible)
|
||||
* IMPORTANT: ctrl-x/a never take possible negative URLs into account, it was just
|
||||
too unpredictable
|
||||
* support for :%foo as a count for commands (not yet widely used)
|
||||
* show informative message when a background tab was loaded, especially useful
|
||||
with a hidden tab bar.
|
||||
* new "l" flag for 'complete' to reuse the Firefox awesome bar for getting better
|
||||
|
||||
@@ -181,14 +181,18 @@ liberator.Commands = function () //{{{
|
||||
// Idea: If v.commands.add() specifies args or opts in extraInfo, don't call the function
|
||||
// with args as a string, but already pass an object like:
|
||||
// args = { -option: value, -anotheroption: true, arguments: [] }
|
||||
OPTION_ANY: 0, // can be given no argument or an argument of any type,
|
||||
// caller is responsible for parsing the return value
|
||||
OPTION_NOARG: 1,
|
||||
OPTION_BOOL:2,
|
||||
OPTION_ANY: 0, // can be given no argument or an argument of any type,
|
||||
// caller is responsible for parsing the return value
|
||||
OPTION_NOARG: 1,
|
||||
OPTION_BOOL: 2,
|
||||
OPTION_STRING: 3,
|
||||
OPTION_INT: 4,
|
||||
OPTION_FLOAT: 5,
|
||||
OPTION_LIST: 6,
|
||||
OPTION_INT: 4,
|
||||
OPTION_FLOAT: 5,
|
||||
OPTION_LIST: 6,
|
||||
|
||||
COUNT_NONE: -1,
|
||||
COUNT_ALL: -2, // :%...
|
||||
|
||||
|
||||
__iterator__: function ()
|
||||
{
|
||||
@@ -591,16 +595,16 @@ liberator.Commands = function () //{{{
|
||||
}
|
||||
|
||||
// 0 - count, 1 - cmd, 2 - special, 3 - args, 4 - heredoc tag
|
||||
var matches = str.match(/^:*(\d+)?([a-zA-Z]+|!)(!)?(?:\s*(.*?)\s*)?$/);
|
||||
var matches = str.match(/^:*(\d+|%)?([a-zA-Z]+|!)(!)?(?:\s*(.*?)\s*)?$/);
|
||||
if (!matches)
|
||||
return [null, null, null, null, null];
|
||||
matches.shift();
|
||||
|
||||
// parse count
|
||||
if (matches[0])
|
||||
matches[0] = parseInt(matches[0], 10);
|
||||
matches[0] = matches[0] == "%" ? this.COUNT_ALL: parseInt(matches[0], 10);
|
||||
else
|
||||
matches[0] = -1;
|
||||
matches[0] = this.COUNT_NONE;
|
||||
|
||||
matches[2] = !!matches[2];
|
||||
matches.push(null);
|
||||
|
||||
Reference in New Issue
Block a user