mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-20 10:17:59 +01:00
Fix zz, zZ, and :zoom {val}, and also spurious ZZ help tag. Closes issue #39.
This commit is contained in:
@@ -1402,11 +1402,7 @@ const Buffer = Module("buffer", {
|
|||||||
else if (/^\d+$/.test(arg))
|
else if (/^\d+$/.test(arg))
|
||||||
level = parseInt(arg, 10);
|
level = parseInt(arg, 10);
|
||||||
else if (/^[+-]\d+$/.test(arg)) {
|
else if (/^[+-]\d+$/.test(arg)) {
|
||||||
if (args.bang)
|
level = this.zoomLevel + parseInt(arg, 10);
|
||||||
level = buffer.fullZoom + parseInt(arg, 10);
|
|
||||||
else
|
|
||||||
level = buffer.textZoom + parseInt(arg, 10);
|
|
||||||
|
|
||||||
// relative args shouldn't take us out of range
|
// relative args shouldn't take us out of range
|
||||||
level = Math.constrain(level, Buffer.ZOOM_MIN, Buffer.ZOOM_MAX);
|
level = Math.constrain(level, Buffer.ZOOM_MIN, Buffer.ZOOM_MAX);
|
||||||
}
|
}
|
||||||
@@ -1730,7 +1726,7 @@ const Buffer = Module("buffer", {
|
|||||||
|
|
||||||
mappings.add(myModes, ["zz"],
|
mappings.add(myModes, ["zz"],
|
||||||
"Set text zoom value of current web page",
|
"Set text zoom value of current web page",
|
||||||
function (count) { buffer.textZoom = count > 1 ? count : 100; },
|
function (count) { Buffer.setZoom(count > 1 ? count : 100, false) },
|
||||||
{ count: true });
|
{ count: true });
|
||||||
|
|
||||||
mappings.add(myModes, ["ZI", "zI"],
|
mappings.add(myModes, ["ZI", "zI"],
|
||||||
@@ -1755,7 +1751,7 @@ const Buffer = Module("buffer", {
|
|||||||
|
|
||||||
mappings.add(myModes, ["zZ"],
|
mappings.add(myModes, ["zZ"],
|
||||||
"Set full zoom value of current web page",
|
"Set full zoom value of current web page",
|
||||||
function (count) { buffer.fullZoom = count > 1 ? count : 100; },
|
function (count) { Buffer.setZoom(count > 1 ? count : 100, true) },
|
||||||
{ count: true });
|
{ count: true });
|
||||||
|
|
||||||
// page info
|
// page info
|
||||||
|
|||||||
@@ -439,9 +439,9 @@
|
|||||||
</item>
|
</item>
|
||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>ZZ zZ</tags>
|
<tags>zZ</tags>
|
||||||
<strut/>
|
<strut/>
|
||||||
<spec><oa>count</oa>ZZ</spec>
|
<spec><oa>count</oa>zZ</spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Set full zoom value of current web page. Zoom value can be between 30 and
|
Set full zoom value of current web page. Zoom value can be between 30 and
|
||||||
|
|||||||
Reference in New Issue
Block a user