1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-23 09:48:00 +01:00

fix :undo - it shouldn't open the last tab when given a non-matching arg

This commit is contained in:
Doug Kearns
2008-10-20 08:44:40 +00:00
parent 86460fd8c5
commit d7cc0b041e

View File

@@ -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);
}, },
{ {