mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-23 21:32:25 +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)
|
||||
{
|
||||
var ss = Components.classes["@mozilla.org/browser/sessionstore;1"]
|
||||
let ss = Components.classes["@mozilla.org/browser/sessionstore;1"]
|
||||
.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++)
|
||||
{
|
||||
if (undoItems[i].state.entries[0].url == args)
|
||||
{
|
||||
count = i + 1;
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!found)
|
||||
{
|
||||
liberator.echoerr("Exxx: No matching closed tab");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
undoCloseTab(count - 1);
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user