From cd66f4dab3ec0bd3bd15b11adc7356a5616b293e Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Fri, 5 Dec 2008 02:56:40 +1100 Subject: [PATCH] use argCount: "?" with :zoom --- common/content/buffer.js | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/common/content/buffer.js b/common/content/buffer.js index 4d03b6ce..739abe88 100644 --- a/common/content/buffer.js +++ b/common/content/buffer.js @@ -599,22 +599,23 @@ function Buffer() //{{{ "Set zoom value of current web page", function (args) { + let arg = args[0]; let level; - if (!args.string) + if (!arg) { level = 100; } - else if (/^\d+$/.test(args.string)) + else if (/^\d+$/.test(arg)) { - level = parseInt(args.string, 10); + level = parseInt(arg, 10); } - else if (/^[+-]\d+$/.test(args.string)) + else if (/^[+-]\d+$/.test(arg)) { if (args.bang) - level = buffer.fullZoom + parseInt(args.string, 10); + level = buffer.fullZoom + parseInt(arg, 10); else - level = buffer.textZoom + parseInt(args.string, 10); + level = buffer.textZoom + parseInt(arg, 10); // relative args shouldn't take us out of range if (level < ZOOM_MIN) @@ -633,7 +634,10 @@ function Buffer() //{{{ else buffer.textZoom = level; }, - { bang: true }); + { + argCount: "?", + bang: true + }); /////////////////////////////////////////////////////////////////////////////}}} ////////////////////// PAGE INFO ///////////////////////////////////////////////