mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-02-14 14:15:47 +01:00
More comprehensive :jumps.
This commit is contained in:
@@ -382,14 +382,6 @@ var Bookmarks = Module("bookmarks", {
|
||||
}, {
|
||||
}, {
|
||||
commands: function () {
|
||||
commands.add(["ju[mps]"],
|
||||
"Show jumplist",
|
||||
function () {
|
||||
let sh = history.session;
|
||||
commandline.commandOutput(template.jumps(sh.index, sh));
|
||||
},
|
||||
{ argCount: "0" });
|
||||
|
||||
// TODO: Clean this up.
|
||||
const tags = {
|
||||
names: ["-tags", "-T"],
|
||||
|
||||
@@ -293,6 +293,33 @@ var History = Module("history", {
|
||||
],
|
||||
privateData: true
|
||||
});
|
||||
|
||||
commands.add(["ju[mps]"],
|
||||
"Show jumplist",
|
||||
function () {
|
||||
let sh = history.session;
|
||||
let index = sh.index;
|
||||
|
||||
let jumps = marks.jumps;
|
||||
if (jumps.index < 0)
|
||||
jumps = [sh[sh.index]];
|
||||
else {
|
||||
index += jumps.index;
|
||||
jumps = jumps.locations.map(function (l) ({
|
||||
__proto__: l,
|
||||
title: buffer.title,
|
||||
get URI() util.newURI(this.location)
|
||||
}));
|
||||
}
|
||||
|
||||
let list = sh.slice(0, sh.index)
|
||||
.concat(jumps)
|
||||
.concat(sh.slice(sh.index + 1));
|
||||
|
||||
commandline.commandOutput(template.jumps(index, list));
|
||||
},
|
||||
{ argCount: "0" });
|
||||
|
||||
},
|
||||
completion: function () {
|
||||
completion.domain = function (context) {
|
||||
|
||||
@@ -133,6 +133,14 @@ var Marks = Module("marks", {
|
||||
});
|
||||
},
|
||||
|
||||
get jumps() {
|
||||
let store = buffer.localStore;
|
||||
return {
|
||||
index: store.jumpsIndex,
|
||||
locations: store.jumps.map(function (j) j.mark)
|
||||
};
|
||||
},
|
||||
|
||||
/**
|
||||
* Remove all marks matching *filter*. If *special* is given, removes all
|
||||
* local marks.
|
||||
|
||||
Reference in New Issue
Block a user