1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-06 16:34:14 +01:00

Add :window to run a command in a new window.

Works like :tab.
This commit is contained in:
Doug Kearns
2009-08-10 21:56:23 +10:00
parent ccb7f5cb77
commit e842bf8cc9
5 changed files with 36 additions and 2 deletions

View File

@@ -496,6 +496,7 @@ const liberator = (function () //{{{
literal: 0 literal: 0
}); });
}); });
commands.add(["exto[ptions]", "extp[references]"], commands.add(["exto[ptions]", "extp[references]"],
"Open an extension's preference dialog", "Open an extension's preference dialog",
function (args) function (args)
@@ -814,6 +815,7 @@ const liberator = (function () //{{{
argCount: "0", argCount: "0",
bang: true bang: true
}); });
}); });
/////////////////////////////////////////////////////////////////////////////}}} /////////////////////////////////////////////////////////////////////////////}}}
@@ -933,6 +935,7 @@ const liberator = (function () //{{{
NEW_WINDOW: 4, NEW_WINDOW: 4,
forceNewTab: false, forceNewTab: false,
forceNewWindow: false,
/** @property {string} The Liberator version string. */ /** @property {string} The Liberator version string. */
version: "###VERSION### (created: ###DATE###)", // these VERSION and DATE tokens are replaced by the Makefile version: "###VERSION### (created: ###DATE###)", // these VERSION and DATE tokens are replaced by the Makefile
@@ -1576,6 +1579,8 @@ const liberator = (function () //{{{
if (liberator.forceNewTab) if (liberator.forceNewTab)
where = liberator.NEW_TAB; where = liberator.NEW_TAB;
else if (liberator.forceNewWindow)
where = liberator.NEW_WINDOW;
else if (!where) else if (!where)
where = liberator.CURRENT_TAB; where = liberator.CURRENT_TAB;

View File

@@ -19,6 +19,7 @@
(this might change again, as this is REALLY inconsistent, and i don't (this might change again, as this is REALLY inconsistent, and i don't
know if I like copying bugs) know if I like copying bugs)
* add [c]:window[c] to run a command in a new window
* add ! version of :delbmarks to delete all bookmarks. * add ! version of :delbmarks to delete all bookmarks.
* new "t" option for 'complete' to also switch to open tabs with :open * new "t" option for 'complete' to also switch to open tabs with :open
* add [c]:toolbaropen[c], [c]:toolbarclose[c], and [c]:toolbartoggle[c] * add [c]:toolbaropen[c], [c]:toolbarclose[c], and [c]:toolbartoggle[c]

View File

@@ -267,6 +267,20 @@ const config = { //{{{
literal: 0 literal: 0
}); });
commands.add(["wind[ow]"],
"Execute a command and tell it to output in a new window",
function (args)
{
liberator.forceNewWindow = true;
liberator.execute(args.string, null, true);
liberator.forceNewWindow = false;
},
{
argCount: "+",
completer: function (context) completion.ex(context),
literal: 0
});
commands.add(["winc[lose]", "wc[lose]"], commands.add(["winc[lose]", "wc[lose]"],
"Close window", "Close window",
function () { window.close(); }, function () { window.close(); },

View File

@@ -1,7 +1,7 @@
" Vim syntax file " Vim syntax file
" Language: VIMperator configuration file " Language: VIMperator configuration file
" Maintainer: Doug Kearns <dougkearns@gmail.com> " Maintainer: Doug Kearns <dougkearns@gmail.com>
" Last Change: 2009 Aug 3 " Last Change: 2009 Aug 10
" TODO: make this vimperator specific - shared liberator config? " TODO: make this vimperator specific - shared liberator config?
@@ -34,7 +34,7 @@ syn keyword vimperatorCommand ab[breviate] ab[clear] addo[ns] bN[ext] b[uffer] b
\ tabdu[plicate] tabe[dit] tabfir[st] tabl[ast] tabm[ove] tabn[ext] tabnew tabo[nly] tabopen tabp[revious] tabr[ewind] tabs \ tabdu[plicate] tabe[dit] tabfir[st] tabl[ast] tabm[ove] tabn[ext] tabnew tabo[nly] tabopen tabp[revious] tabr[ewind] tabs
\ tbh[ide] tbs[how] tbt[oggle] time tn[ext] toolbarh[ide] toolbars[how] toolbart[oggle] tp[revious] u[ndo] una[bbreviate] \ tbh[ide] tbs[how] tbt[oggle] time tn[ext] toolbarh[ide] toolbars[how] toolbart[oggle] tp[revious] u[ndo] una[bbreviate]
\ undoa[ll] unl[et] unm[ap] ve[rsion] vie[wsource] viu[sage] vm[ap] vmap[clear] vno[remap] vu[nmap] w[rite] wc[lose] win[open] \ undoa[ll] unl[et] unm[ap] ve[rsion] vie[wsource] viu[sage] vm[ap] vmap[clear] vno[remap] vu[nmap] w[rite] wc[lose] win[open]
\ winc[lose] wine[dit] wo[pen] wq wqa[ll] xa[ll] zo[om] \ winc[lose] wind[ow] wine[dit] wo[pen] wq wqa[ll] xa[ll] zo[om]
\ contained \ contained
syn match vimperatorCommand "!" contained syn match vimperatorCommand "!" contained

View File

@@ -29,6 +29,20 @@ support it, currently:
________________________________________________________________________________ ________________________________________________________________________________
// TODO: move this somewhere more appropriate
|:window| |:wind | +
||:wind[ow] {cmd}||
________________________________________________________________________________
Execute {cmd} and tell it to output in a new window. Works only for commands
that support it, currently:
* [c]:tab help[c]
* [c]:tab prefs[!][c]
* [c]:tab addons[c]
* [c]:tab downloads[c]
________________________________________________________________________________
|:tabdu| |:tabduplicate| |:tabdu| |:tabduplicate|
||:[count]tabdu[plicate]|| + ||:[count]tabdu[plicate]|| +
________________________________________________________________________________ ________________________________________________________________________________