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

added 2 scripts, and :%foo support

This commit is contained in:
Martin Stubenschrott
2008-06-30 12:50:15 +00:00
parent 9d84f6bc0b
commit 6d8b16608f
3 changed files with 16 additions and 10 deletions

View File

@@ -12,6 +12,7 @@ Inactive/former developers:
* Viktor Kojouharov (Виктор Кожухаров) * Viktor Kojouharov (Виктор Кожухаров)
Patches (in no special order): Patches (in no special order):
* Konstantin Stepanov (:%foo support)
* Lukas Mai * Lukas Mai
* Guido Van Hoecke * Guido Van Hoecke
* Daniel Trstenjak (various things with hints) * Daniel Trstenjak (various things with hints)

1
NEWS
View File

@@ -8,6 +8,7 @@
generous donation which made this behavior possible) generous donation which made this behavior possible)
* IMPORTANT: ctrl-x/a never take possible negative URLs into account, it was just * IMPORTANT: ctrl-x/a never take possible negative URLs into account, it was just
too unpredictable 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 * show informative message when a background tab was loaded, especially useful
with a hidden tab bar. with a hidden tab bar.
* new "l" flag for 'complete' to reuse the Firefox awesome bar for getting better * new "l" flag for 'complete' to reuse the Firefox awesome bar for getting better

View File

@@ -190,6 +190,10 @@ liberator.Commands = function () //{{{
OPTION_FLOAT: 5, OPTION_FLOAT: 5,
OPTION_LIST: 6, OPTION_LIST: 6,
COUNT_NONE: -1,
COUNT_ALL: -2, // :%...
__iterator__: function () __iterator__: function ()
{ {
var sorted = exCommands.sort(function (cmd1, cmd2) { return cmd1.name > cmd2.name; }); var sorted = exCommands.sort(function (cmd1, cmd2) { return cmd1.name > cmd2.name; });
@@ -591,16 +595,16 @@ liberator.Commands = function () //{{{
} }
// 0 - count, 1 - cmd, 2 - special, 3 - args, 4 - heredoc tag // 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) if (!matches)
return [null, null, null, null, null]; return [null, null, null, null, null];
matches.shift(); matches.shift();
// parse count // parse count
if (matches[0]) if (matches[0])
matches[0] = parseInt(matches[0], 10); matches[0] = matches[0] == "%" ? this.COUNT_ALL: parseInt(matches[0], 10);
else else
matches[0] = -1; matches[0] = this.COUNT_NONE;
matches[2] = !!matches[2]; matches[2] = !!matches[2];
matches.push(null); matches.push(null);