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

Rename :tabreattach to :tabattach.

As Kris noted this may be better implemented as :tabmove -window.
This commit is contained in:
Doug Kearns
2009-09-30 19:48:34 +10:00
parent 422579f6e2
commit f79c6e8dc1
7 changed files with 24 additions and 16 deletions

View File

@@ -900,7 +900,8 @@ const liberator = (function () //{{{
completion.window = function window(context) {
context.title = ["Window", "Title"]
context.completions = [[i, win.document.title] for ([i, win] in Iterator(liberator.windows))];
context.keys = { text: function (win) liberator.windows.indexOf(win) + 1, description: function (win) win.document.title };
context.completions = liberator.windows;
};
});

View File

@@ -621,15 +621,15 @@ function Tabs() //{{{
// TODO: match window by title too?
// : accept the full :tabmove arg spec for the tab index arg?
// : better name or merge with :tabmove?
commands.add(["tabrea[ttach]"],
"Reattach the current tab to another window",
commands.add(["taba[ttach]"],
"Attach the current tab to another window",
function (args)
{
if (args.length > 2 || args.some(function (i) i && !/^\d+$/.test(i)))
return void liberator.echoerr("E488: Trailing characters");
let [winIndex, tabIndex] = args;
let win = liberator.windows[winIndex];
let [winIndex, tabIndex] = args.map(parseInt);
let win = liberator.windows[winIndex - 1];
if (!win)
return void liberator.echoerr("Window " + winIndex + " does not exist");
@@ -638,12 +638,16 @@ function Tabs() //{{{
let browser = win.getBrowser();
let dummy = browser.addTab("about:blank");
browser.stop();
// XXX: the implementation of DnD in tabbrowser.xml suggests
// that we may not be guaranteed of having a docshell here
// without this reference?
browser.docShell;
let last = browser.mTabs.length - 1;
browser.moveTabTo(dummy, util.Math.constrain(tabIndex || last, 0, last));
browser.selectedTab = dummy; // required
browser.stop();
browser.docShell;
browser.swapBrowsersAndCloseOther(dummy, getBrowser().mCurrentTab);
},
{
@@ -651,7 +655,10 @@ function Tabs() //{{{
completer: function (context, args)
{
if (args.completeArg == 0)
{
context.filters.push(function ({ item: win }) win != window);
completion.window(context);
}
}
});
}

View File

@@ -19,7 +19,7 @@
know if I like copying bugs)
* IMPORTANT: 'popups' now takes a stringlist rather than a number.
* add [c]:tabreattach[c]
* add [c]:tabattach[c]
* add [c]:keepalt[c]
* add [c]:styledisable[c], [c]:styleenable[c], and [c]:styletoggle[c]
* add [c]:sanitize[c], 'sanitizetimespan' and 'sanitizeitems'

View File

@@ -250,6 +250,7 @@ section::Ex{nbsp}commands[ex-cmd-index,:index]
||[c]:stopall[c]|| Stop loading all tab pages +
||[c]:style[c]|| Style Vimperator and web sites +
||[c]:tab[c]|| Execute a command and tell it to output in a new tab +
||[c]:tabattach[c]|| Attach the current tab to another window +
||[c]:tabdetach[c]|| Detach current tab to its own window +
||[c]:tabdo[c]|| Execute a command in each tab +
||[c]:tabduplicate[c]|| Duplicate current tab +
@@ -259,7 +260,6 @@ section::Ex{nbsp}commands[ex-cmd-index,:index]
||[c]:tabonly[c]|| Close all other tabs +
||[c]:tabopen[c]|| Open one or more URLs in a new tab +
||[c]:tabprevious[c]|| Switch to the previous tab or go [count] tabs back +
||[c]:tabreattach[c]|| Reattach the current tab to another window +
||[c]:tabrewind[c]|| Switch to the first tab +
||[c]:time[c]|| Profile a piece of code or run a command multiple times +
||[c]toolbarhide[c]|| Hide the named toolbar +

View File

@@ -161,10 +161,10 @@ Use [c]:tabduplicate[c] to copy the tab then call [c]:tabdetach[c].
________________________________________________________________________________
|:tabrea| |:tabreattach|
||:tabrea[ttach] {window-index} [tab-index]|| +
|:taba| |:tabattach|
||:taba[ttach] {window-index} [tab-index]|| +
________________________________________________________________________________
Reattach the current tab to another window. {window-index} is an index into the
Attach the current tab to another window. {window-index} is an index into the
list of open windows and [a][tab-index][a] is the index at which to insert the
tab in the other window's tab list. If this is the last tab in a window, the
window will be closed.

View File

@@ -296,6 +296,7 @@ section::Ex{nbsp}commands[ex-cmd-index,:index]
||[c]:stopall[c]|| Stop loading all tab pages +
||[c]:style[c]|| Style Xulmus and web sites +
||[c]:tab[c]|| Execute a command and tell it to output in a new tab +
||[c]:tabattach[c]|| Attach the current tab to another window +
||[c]:tabdetach[c]|| Detach current tab to its own window +
||[c]:tabdo[c]|| Execute a command in each tab +
||[c]:tabduplicate[c]|| Duplicate current tab +
@@ -305,7 +306,6 @@ section::Ex{nbsp}commands[ex-cmd-index,:index]
||[c]:tabonly[c]|| Close all other tabs +
||[c]:tabopen[c]|| Open one or more URLs in a new tab +
||[c]:tabprevious[c]|| Switch to the previous tab or go [count] tabs back +
||[c]:tabreattach[c]|| Reattach the current tab to another window +
||[c]:tabrewind[c]|| Switch to the first tab +
||[c]:time[c]|| Profile a piece of code or run a command multiple times +
||[c]toolbarhide[c]|| Hide the named toolbar +

View File

@@ -152,10 +152,10 @@ Use [c]:tabduplicate[c] to copy the tab then call [c]:tabdetach[c].
________________________________________________________________________________
|:tabrea| |:tabreattach|
||:tabrea[ttach] {window-index} [tab-index]|| +
|:taba| |:tabattach|
||:taba[ttach] {window-index} [tab-index]|| +
________________________________________________________________________________
Reattach the current tab to another window. {window-index} is an index into the
Attach the current tab to another window. {window-index} is an index into the
list of open windows and [a][tab-index][a] is the index at which to insert the
tab in the other window's tab list. If this is the last tab in a window, the
window will be closed.