diff --git a/common/content/bookmarks.js b/common/content/bookmarks.js index 79e19360..bac3335b 100644 --- a/common/content/bookmarks.js +++ b/common/content/bookmarks.js @@ -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"], diff --git a/common/content/history.js b/common/content/history.js index 6670b3ac..fdaedff1 100644 --- a/common/content/history.js +++ b/common/content/history.js @@ -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) { diff --git a/common/content/marks.js b/common/content/marks.js index 53b14788..4454ce17 100644 --- a/common/content/marks.js +++ b/common/content/marks.js @@ -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. diff --git a/common/locale/en-US/messages.properties b/common/locale/en-US/messages.properties index 062fa056..b82fe6e5 100644 --- a/common/locale/en-US/messages.properties +++ b/common/locale/en-US/messages.properties @@ -344,6 +344,9 @@ title.Totals = Totals title.URI = URI title.Version = Version +title.HPos = HPos +title.VPos = VPos + variable.none = No variables found window.cantAttachSame = Can't reattach to the same window diff --git a/common/modules/template.jsm b/common/modules/template.jsm index b8aff65f..1ce8b9a7 100644 --- a/common/modules/template.jsm +++ b/common/modules/template.jsm @@ -392,6 +392,8 @@ var Template = Module("Template", { return
| {_("title.Jump")} | +{_("title.HPos")} | +{_("title.VPos")} | {_("title.Title")} | {_("title.URI")} | |
|---|---|---|---|---|---|
| {idx == index ? ">" : ""} | {Math.abs(idx - index)} | +{val.offset ? val.offset.x : ""} | +{val.offset ? val.offset.y : ""} | {util.losslessDecodeURI(val.URI.spec)} | |