mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-20 11:08:09 +01:00
Add g].
This commit is contained in:
@@ -820,8 +820,9 @@ var Buffer = Module("buffer", {
|
|||||||
* @param {number} count The number of elements to jump.
|
* @param {number} count The number of elements to jump.
|
||||||
* @optional
|
* @optional
|
||||||
* @param {boolean} reverse If true, search backwards. @optional
|
* @param {boolean} reverse If true, search backwards. @optional
|
||||||
|
* @param {boolean} offScreen If true, include only off-screen elements. @optional
|
||||||
*/
|
*/
|
||||||
findJump: function findJump(arg, count, reverse) {
|
findJump: function findJump(arg, count, reverse, offScreen) {
|
||||||
const FUDGE = 10;
|
const FUDGE = 10;
|
||||||
|
|
||||||
let path = options["jumptags"][arg];
|
let path = options["jumptags"][arg];
|
||||||
@@ -832,6 +833,9 @@ var Buffer = Module("buffer", {
|
|||||||
.filter(function (e) e[1] > FUDGE)
|
.filter(function (e) e[1] > FUDGE)
|
||||||
.sort(function (a, b) a[1] - b[1])
|
.sort(function (a, b) a[1] - b[1])
|
||||||
|
|
||||||
|
if (offScreen && !reverse)
|
||||||
|
elems = elems.filter(function (e) e[1] > this, window.innerHeight);
|
||||||
|
|
||||||
let idx = Math.min((count || 1) - 1, elems.length);
|
let idx = Math.min((count || 1) - 1, elems.length);
|
||||||
dactyl.assert(idx in elems);
|
dactyl.assert(idx in elems);
|
||||||
|
|
||||||
@@ -1840,6 +1844,11 @@ var Buffer = Module("buffer", {
|
|||||||
function (args) { buffer.findJump(args.arg, args.count, true); },
|
function (args) { buffer.findJump(args.arg, args.count, true); },
|
||||||
{ arg: true, count: true });
|
{ arg: true, count: true });
|
||||||
|
|
||||||
|
mappings.add([modes.NORMAL], ["g]"],
|
||||||
|
"Jump to the next off-screen element as defined by 'jumptags'",
|
||||||
|
function (args) { buffer.findJump(args.arg, args.count, false, true); },
|
||||||
|
{ arg: true, count: true });
|
||||||
|
|
||||||
mappings.add([modes.NORMAL], ["]"],
|
mappings.add([modes.NORMAL], ["]"],
|
||||||
"Jump to the next element as defined by 'jumptags'",
|
"Jump to the next element as defined by 'jumptags'",
|
||||||
function (args) { buffer.findJump(args.arg, args.count, false); },
|
function (args) { buffer.findJump(args.arg, args.count, false); },
|
||||||
|
|||||||
@@ -171,10 +171,10 @@ var Marks = Module("marks", {
|
|||||||
var node = buffer.findScrollable(0, (mark.offset || mark.position).x)
|
var node = buffer.findScrollable(0, (mark.offset || mark.position).x)
|
||||||
else
|
else
|
||||||
for (node in util.evaluateXPath(mark.xpath, buffer.focusedFrame.document))
|
for (node in util.evaluateXPath(mark.xpath, buffer.focusedFrame.document))
|
||||||
;
|
break;
|
||||||
|
|
||||||
util.assert(node);
|
util.assert(node);
|
||||||
util.scrollIntoView(node, true);
|
util.scrollIntoView(node);
|
||||||
|
|
||||||
if (mark.position)
|
if (mark.position)
|
||||||
Buffer.scrollToPercent(node, mark.position.x * 100, mark.position.y * 100);
|
Buffer.scrollToPercent(node, mark.position.x * 100, mark.position.y * 100);
|
||||||
|
|||||||
@@ -344,6 +344,15 @@
|
|||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
|
<item>
|
||||||
|
<tags>g]</tags>
|
||||||
|
<spec><oa>count</oa>]<a>arg</a></spec>
|
||||||
|
<description short="true">
|
||||||
|
<p>Jump to the next off-screen element as defined by <o>jumptags</o>.</p>
|
||||||
|
</description>
|
||||||
|
</item>
|
||||||
|
|
||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>{</tags>
|
<tags>{</tags>
|
||||||
<spec><oa>count</oa>{</spec>
|
<spec><oa>count</oa>{</spec>
|
||||||
|
|||||||
@@ -81,7 +81,7 @@
|
|||||||
- Added site-specific mapping groups and related command
|
- Added site-specific mapping groups and related command
|
||||||
changes. [b6]
|
changes. [b6]
|
||||||
- Added 'timeout' and 'timeoutlen' options. [b6]
|
- Added 'timeout' and 'timeoutlen' options. [b6]
|
||||||
- Added n_{, n_}, n_[, and n_] mappings. [b7]
|
- Added n_{, n_}, n_[, n_], and n_g] mappings. [b7]
|
||||||
- Added <A-b> to execute a builtin mapping. [b6]
|
- Added <A-b> to execute a builtin mapping. [b6]
|
||||||
- Added <A-m>l and <A-m>s to aid in the construction of
|
- Added <A-m>l and <A-m>s to aid in the construction of
|
||||||
macros. [b6]
|
macros. [b6]
|
||||||
|
|||||||
Reference in New Issue
Block a user