mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-20 09:27:58 +01:00
Rename :tabreattach to :tabattach.
As Kris noted this may be better implemented as :tabmove -window.
This commit is contained in:
@@ -900,7 +900,8 @@ const liberator = (function () //{{{
|
|||||||
|
|
||||||
completion.window = function window(context) {
|
completion.window = function window(context) {
|
||||||
context.title = ["Window", "Title"]
|
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;
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -621,15 +621,15 @@ function Tabs() //{{{
|
|||||||
// TODO: match window by title too?
|
// TODO: match window by title too?
|
||||||
// : accept the full :tabmove arg spec for the tab index arg?
|
// : accept the full :tabmove arg spec for the tab index arg?
|
||||||
// : better name or merge with :tabmove?
|
// : better name or merge with :tabmove?
|
||||||
commands.add(["tabrea[ttach]"],
|
commands.add(["taba[ttach]"],
|
||||||
"Reattach the current tab to another window",
|
"Attach the current tab to another window",
|
||||||
function (args)
|
function (args)
|
||||||
{
|
{
|
||||||
if (args.length > 2 || args.some(function (i) i && !/^\d+$/.test(i)))
|
if (args.length > 2 || args.some(function (i) i && !/^\d+$/.test(i)))
|
||||||
return void liberator.echoerr("E488: Trailing characters");
|
return void liberator.echoerr("E488: Trailing characters");
|
||||||
|
|
||||||
let [winIndex, tabIndex] = args;
|
let [winIndex, tabIndex] = args.map(parseInt);
|
||||||
let win = liberator.windows[winIndex];
|
let win = liberator.windows[winIndex - 1];
|
||||||
|
|
||||||
if (!win)
|
if (!win)
|
||||||
return void liberator.echoerr("Window " + winIndex + " does not exist");
|
return void liberator.echoerr("Window " + winIndex + " does not exist");
|
||||||
@@ -638,12 +638,16 @@ function Tabs() //{{{
|
|||||||
|
|
||||||
let browser = win.getBrowser();
|
let browser = win.getBrowser();
|
||||||
let dummy = browser.addTab("about:blank");
|
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;
|
let last = browser.mTabs.length - 1;
|
||||||
|
|
||||||
browser.moveTabTo(dummy, util.Math.constrain(tabIndex || last, 0, last));
|
browser.moveTabTo(dummy, util.Math.constrain(tabIndex || last, 0, last));
|
||||||
browser.selectedTab = dummy; // required
|
browser.selectedTab = dummy; // required
|
||||||
browser.stop();
|
|
||||||
browser.docShell;
|
|
||||||
browser.swapBrowsersAndCloseOther(dummy, getBrowser().mCurrentTab);
|
browser.swapBrowsersAndCloseOther(dummy, getBrowser().mCurrentTab);
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -651,7 +655,10 @@ function Tabs() //{{{
|
|||||||
completer: function (context, args)
|
completer: function (context, args)
|
||||||
{
|
{
|
||||||
if (args.completeArg == 0)
|
if (args.completeArg == 0)
|
||||||
|
{
|
||||||
|
context.filters.push(function ({ item: win }) win != window);
|
||||||
completion.window(context);
|
completion.window(context);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
know if I like copying bugs)
|
know if I like copying bugs)
|
||||||
* IMPORTANT: 'popups' now takes a stringlist rather than a number.
|
* IMPORTANT: 'popups' now takes a stringlist rather than a number.
|
||||||
|
|
||||||
* add [c]:tabreattach[c]
|
* add [c]:tabattach[c]
|
||||||
* add [c]:keepalt[c]
|
* add [c]:keepalt[c]
|
||||||
* add [c]:styledisable[c], [c]:styleenable[c], and [c]:styletoggle[c]
|
* add [c]:styledisable[c], [c]:styleenable[c], and [c]:styletoggle[c]
|
||||||
* add [c]:sanitize[c], 'sanitizetimespan' and 'sanitizeitems'
|
* add [c]:sanitize[c], 'sanitizetimespan' and 'sanitizeitems'
|
||||||
|
|||||||
@@ -250,6 +250,7 @@ section::Ex{nbsp}commands[ex-cmd-index,:index]
|
|||||||
||[c]:stopall[c]|| Stop loading all tab pages +
|
||[c]:stopall[c]|| Stop loading all tab pages +
|
||||||
||[c]:style[c]|| Style Vimperator and web sites +
|
||[c]:style[c]|| Style Vimperator and web sites +
|
||||||
||[c]:tab[c]|| Execute a command and tell it to output in a new tab +
|
||[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]:tabdetach[c]|| Detach current tab to its own window +
|
||||||
||[c]:tabdo[c]|| Execute a command in each tab +
|
||[c]:tabdo[c]|| Execute a command in each tab +
|
||||||
||[c]:tabduplicate[c]|| Duplicate current 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]:tabonly[c]|| Close all other tabs +
|
||||||
||[c]:tabopen[c]|| Open one or more URLs in a new tab +
|
||[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]: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]:tabrewind[c]|| Switch to the first tab +
|
||||||
||[c]:time[c]|| Profile a piece of code or run a command multiple times +
|
||[c]:time[c]|| Profile a piece of code or run a command multiple times +
|
||||||
||[c]toolbarhide[c]|| Hide the named toolbar +
|
||[c]toolbarhide[c]|| Hide the named toolbar +
|
||||||
|
|||||||
@@ -161,10 +161,10 @@ Use [c]:tabduplicate[c] to copy the tab then call [c]:tabdetach[c].
|
|||||||
________________________________________________________________________________
|
________________________________________________________________________________
|
||||||
|
|
||||||
|
|
||||||
|:tabrea| |:tabreattach|
|
|:taba| |:tabattach|
|
||||||
||:tabrea[ttach] {window-index} [tab-index]|| +
|
||: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
|
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
|
tab in the other window's tab list. If this is the last tab in a window, the
|
||||||
window will be closed.
|
window will be closed.
|
||||||
|
|||||||
@@ -296,6 +296,7 @@ section::Ex{nbsp}commands[ex-cmd-index,:index]
|
|||||||
||[c]:stopall[c]|| Stop loading all tab pages +
|
||[c]:stopall[c]|| Stop loading all tab pages +
|
||||||
||[c]:style[c]|| Style Xulmus and web sites +
|
||[c]:style[c]|| Style Xulmus and web sites +
|
||||||
||[c]:tab[c]|| Execute a command and tell it to output in a new tab +
|
||[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]:tabdetach[c]|| Detach current tab to its own window +
|
||||||
||[c]:tabdo[c]|| Execute a command in each tab +
|
||[c]:tabdo[c]|| Execute a command in each tab +
|
||||||
||[c]:tabduplicate[c]|| Duplicate current 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]:tabonly[c]|| Close all other tabs +
|
||||||
||[c]:tabopen[c]|| Open one or more URLs in a new tab +
|
||[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]: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]:tabrewind[c]|| Switch to the first tab +
|
||||||
||[c]:time[c]|| Profile a piece of code or run a command multiple times +
|
||[c]:time[c]|| Profile a piece of code or run a command multiple times +
|
||||||
||[c]toolbarhide[c]|| Hide the named toolbar +
|
||[c]toolbarhide[c]|| Hide the named toolbar +
|
||||||
|
|||||||
@@ -152,10 +152,10 @@ Use [c]:tabduplicate[c] to copy the tab then call [c]:tabdetach[c].
|
|||||||
________________________________________________________________________________
|
________________________________________________________________________________
|
||||||
|
|
||||||
|
|
||||||
|:tabrea| |:tabreattach|
|
|:taba| |:tabattach|
|
||||||
||:tabrea[ttach] {window-index} [tab-index]|| +
|
||: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
|
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
|
tab in the other window's tab list. If this is the last tab in a window, the
|
||||||
window will be closed.
|
window will be closed.
|
||||||
|
|||||||
Reference in New Issue
Block a user