mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-22 11:17:58 +01:00
fix :back/:forward completers
This commit is contained in:
@@ -697,18 +697,10 @@ function History() //{{{
|
|||||||
bang: true,
|
bang: true,
|
||||||
completer: function completer(context)
|
completer: function completer(context)
|
||||||
{
|
{
|
||||||
let filter = context.filter;
|
let sh = window.getWebNavigation().sessionHistory;
|
||||||
var sh = window.getWebNavigation().sessionHistory;
|
|
||||||
var completions = [];
|
context.completions = [sh.getEntryAtIndex(i, false) for (i in util.range(sh.index, 0, true))];
|
||||||
for (let i in util.range(sh.index, 0, true))
|
context.keys = { text: function (item) item.URI.spec, description: "title" };
|
||||||
{
|
|
||||||
var entry = sh.getEntryAtIndex(i, false);
|
|
||||||
var url = entry.URI.spec;
|
|
||||||
var title = entry.title;
|
|
||||||
if (completion.match([url, title], filter, false))
|
|
||||||
completions.push([url, title]);
|
|
||||||
}
|
|
||||||
return [0, completions];
|
|
||||||
},
|
},
|
||||||
count: true,
|
count: true,
|
||||||
literal: 0
|
literal: 0
|
||||||
@@ -750,18 +742,10 @@ function History() //{{{
|
|||||||
bang: true,
|
bang: true,
|
||||||
completer: function completer(context)
|
completer: function completer(context)
|
||||||
{
|
{
|
||||||
let filter = context.filter;
|
let sh = window.getWebNavigation().sessionHistory;
|
||||||
var sh = window.getWebNavigation().sessionHistory;
|
|
||||||
var completions = [];
|
context.completions = [sh.getEntryAtIndex(i, false) for (i in util.range(sh.index + 1, sh.count))];
|
||||||
for (let i in util.range(sh.index + 1, sh.count))
|
context.keys = { text: function (item) item.URI.spec, description: "title" };
|
||||||
{
|
|
||||||
var entry = sh.getEntryAtIndex(i, false);
|
|
||||||
var url = entry.URI.spec;
|
|
||||||
var title = entry.title;
|
|
||||||
if (completion.match([url, title], filter, false))
|
|
||||||
completions.push([url, title]);
|
|
||||||
}
|
|
||||||
return [0, completions];
|
|
||||||
},
|
},
|
||||||
count: true,
|
count: true,
|
||||||
literal: 0
|
literal: 0
|
||||||
|
|||||||
Reference in New Issue
Block a user