mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-23 11:58:00 +01:00
fix :undo - it shouldn't open the last tab when given a non-matching arg
This commit is contained in:
@@ -584,18 +584,28 @@ function Tabs() //{{{
|
|||||||
|
|
||||||
if (args)
|
if (args)
|
||||||
{
|
{
|
||||||
var ss = Components.classes["@mozilla.org/browser/sessionstore;1"]
|
let ss = Components.classes["@mozilla.org/browser/sessionstore;1"]
|
||||||
.getService(Components.interfaces.nsISessionStore);
|
.getService(Components.interfaces.nsISessionStore);
|
||||||
var undoItems = eval("(" + ss.getClosedTabData(window) + ")");
|
let undoItems = eval("(" + ss.getClosedTabData(window) + ")");
|
||||||
|
let found = false;
|
||||||
|
|
||||||
for (let i = 0; i < undoItems.length; i++)
|
for (let i = 0; i < undoItems.length; i++)
|
||||||
{
|
{
|
||||||
if (undoItems[i].state.entries[0].url == args)
|
if (undoItems[i].state.entries[0].url == args)
|
||||||
{
|
{
|
||||||
count = i + 1;
|
count = i + 1;
|
||||||
|
found = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!found)
|
||||||
|
{
|
||||||
|
liberator.echoerr("Exxx: No matching closed tab");
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
undoCloseTab(count - 1);
|
undoCloseTab(count - 1);
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user