mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-02-24 19:25:52 +01:00
Fix completion.buffer
This commit is contained in:
@@ -1177,26 +1177,26 @@ function Completion() //{{{
|
|||||||
buffer: function buffer(context)
|
buffer: function buffer(context)
|
||||||
{
|
{
|
||||||
filter = context.filter.toLowerCase();
|
filter = context.filter.toLowerCase();
|
||||||
|
context.anchored = false;
|
||||||
context.title = ["Buffer", "URL"];
|
context.title = ["Buffer", "URL"];
|
||||||
context.keys = { text: "text", description: "url", icon: "icon" };
|
context.keys = { text: "text", description: "url", icon: "icon" };
|
||||||
let process = context.process[0];
|
let process = context.process[0];
|
||||||
context.process = [function (item)
|
context.process = [function (item, text)
|
||||||
<>
|
<>
|
||||||
<span highlight="Indicator" style="display: inline-block; width: 1.5em; text-align: center">{item.item.indicator}</span>
|
<span highlight="Indicator" style="display: inline-block; width: 1.5em; text-align: center">{item.item.indicator}</span>
|
||||||
{ process.call(this, item) }
|
{ process.call(this, item, text) }
|
||||||
</>];
|
</>];
|
||||||
|
|
||||||
context.completions = util.map(tabs.browsers, function ([i, browser]) {
|
context.completions = util.map(tabs.browsers, function ([i, browser]) {
|
||||||
|
let indicator = " ";
|
||||||
if (i == tabs.index())
|
if (i == tabs.index())
|
||||||
indicator = "%"
|
indicator = "%"
|
||||||
else if (i == tabs.index(tabs.alternate))
|
else if (i == tabs.index(tabs.alternate))
|
||||||
indicator = "#";
|
indicator = "#";
|
||||||
else
|
|
||||||
indicator = " ";
|
|
||||||
|
|
||||||
let tab = tabs.getTab(i);
|
let tab = tabs.getTab(i);
|
||||||
i = i + 1;
|
|
||||||
let url = browser.contentDocument.location.href;
|
let url = browser.contentDocument.location.href;
|
||||||
|
i = i + 1;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
text: [i + ": " + (tab.label || "(Untitled)"), i + ": " + url],
|
text: [i + ": " + (tab.label || "(Untitled)"), i + ": " + url],
|
||||||
|
|||||||
Reference in New Issue
Block a user