All pastes #2465200 Raw Copy code Copy link Edit

Unnamed

public unlisted javascript v1 · immutable
#2465200 ·published 2013-10-10 14:40 UTC
rendered paste body
function locationBackForCompleter(context, isBack) {    let sh = history.session;    context.anchored = false;    context.compare = CompletionContext.Sort.unsorted;    context.filters = [CompletionContext.Filter.textDescription];    context.completions = [        {            "0": (i + 1) + ": " + item.URI.spec,            "1": item.title,            icon: item.icon,        }        for ([i, item] in            Iterator(isBack  ? sh.slice(0, sh.index).reverse()                    : sh.slice(sh.index + 1)))    ];}for (let values of [["back", true], ["forward", false]]) {    let [s, flag] = values;    commands.get(s).completer = function (context) locationBackForCompleter(context, flag);}