mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-04-15 21:23:31 +02:00
Add "t" option to 'complete'. Visually it looks odd, that the icons are
more indented than others, we might want to remove or at least move the % and # indicators
This commit is contained in:
@@ -1491,7 +1491,20 @@ const liberator = (function () //{{{
|
|||||||
// convert the string to an array of converted URLs
|
// convert the string to an array of converted URLs
|
||||||
// -> see util.stringToURLArray for more details
|
// -> see util.stringToURLArray for more details
|
||||||
if (typeof urls == "string")
|
if (typeof urls == "string")
|
||||||
|
{
|
||||||
|
// rather switch to the tab instead of opening a new url in case of "12: Tab Title" like "urls"
|
||||||
|
if (liberator.has("tabs"))
|
||||||
|
{
|
||||||
|
let matches = urls.match(/^(\d+):/);
|
||||||
|
if (matches)
|
||||||
|
{
|
||||||
|
tabs.select(parseInt(matches[1], 10) - 1, false); // make it zero-based
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
urls = util.stringToURLArray(urls);
|
urls = util.stringToURLArray(urls);
|
||||||
|
}
|
||||||
|
|
||||||
if (urls.length > 20 && !force)
|
if (urls.length > 20 && !force)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -645,6 +645,10 @@ function Tabs() //{{{
|
|||||||
{ argCount: "0" });
|
{ argCount: "0" });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
completion.addUrlCompleter("t",
|
||||||
|
"Open tabs",
|
||||||
|
completion.buffer);
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////}}}
|
/////////////////////////////////////////////////////////////////////////////}}}
|
||||||
////////////////////// PUBLIC SECTION //////////////////////////////////////////
|
////////////////////// PUBLIC SECTION //////////////////////////////////////////
|
||||||
/////////////////////////////////////////////////////////////////////////////{{{
|
/////////////////////////////////////////////////////////////////////////////{{{
|
||||||
|
|||||||
@@ -770,7 +770,7 @@ function CommandLine() //{{{
|
|||||||
|
|
||||||
options.add(["complete", "cpt"],
|
options.add(["complete", "cpt"],
|
||||||
"Items which are completed at the :open prompts",
|
"Items which are completed at the :open prompts",
|
||||||
"charlist", "slf",
|
"charlist", typeof(config.defaults["complete"]) == "string" ? config.defaults["complete"] : "slf",
|
||||||
{
|
{
|
||||||
completer: function (context) [k for each (k in completion.urlCompleters)],
|
completer: function (context) [k for each (k in completion.urlCompleters)],
|
||||||
validator: Option.validateCompleter
|
validator: Option.validateCompleter
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
2009-XX-XX:
|
2009-XX-XX:
|
||||||
* version 2.2a1pre
|
* version 2.2a1pre
|
||||||
|
* IMPORTANT: the 'complete' option's default has changed (again) to "stlf"
|
||||||
* IMPORTANT: Map.flags has been replaced with individual properties.
|
* IMPORTANT: Map.flags has been replaced with individual properties.
|
||||||
Mappings defined in plugins with mappings.add will need to be updated.
|
Mappings defined in plugins with mappings.add will need to be updated.
|
||||||
...................................
|
...................................
|
||||||
@@ -15,7 +16,10 @@
|
|||||||
...................................
|
...................................
|
||||||
* IMPORTANT: shifted key notation now matches Vim's behaviour. E.g. <C-a>
|
* IMPORTANT: shifted key notation now matches Vim's behaviour. E.g. <C-a>
|
||||||
and <C-A> are equivalent, to map the uppercase character use <C-S-A>.
|
and <C-A> are equivalent, to map the uppercase character use <C-S-A>.
|
||||||
|
(this might change again, as this is REALLY inconsistent, and i don't
|
||||||
|
know if I like copying bugs)
|
||||||
|
|
||||||
|
* 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]
|
||||||
* make [c]:open[c] behavior match that of [c]:tabopen[c] and [c]:winopen[c]
|
* make [c]:open[c] behavior match that of [c]:tabopen[c] and [c]:winopen[c]
|
||||||
when no argument is specified
|
when no argument is specified
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ const config = { //{{{
|
|||||||
/*** optional options, there are checked for existence and a fallback provided ***/
|
/*** optional options, there are checked for existence and a fallback provided ***/
|
||||||
features: ["bookmarks", "hints", "history", "marks", "quickmarks", "session", "tabs", "tabs_undo", "windows"],
|
features: ["bookmarks", "hints", "history", "marks", "quickmarks", "session", "tabs", "tabs_undo", "windows"],
|
||||||
defaults: {
|
defaults: {
|
||||||
|
complete: "stlf",
|
||||||
guioptions: "rb",
|
guioptions: "rb",
|
||||||
showtabline: 2,
|
showtabline: 2,
|
||||||
titlestring: "Vimperator"
|
titlestring: "Vimperator"
|
||||||
|
|||||||
@@ -59,6 +59,12 @@ tag "linux" and which contain "torvalds". Note that -tags support is only
|
|||||||
available for tab completion, not for the actual command.
|
available for tab completion, not for the actual command.
|
||||||
The items which are completed on [m]<Tab>[m] are specified in the 'complete'
|
The items which are completed on [m]<Tab>[m] are specified in the 'complete'
|
||||||
option.
|
option.
|
||||||
|
|
||||||
|
Sometimes, you might not be aware if you already have a certain page loaded in
|
||||||
|
some background tab or not. Therefore you can just type [c]:open facebook<Tab>[c]
|
||||||
|
and switch to it if Facebook is already open, or otherwise open it (if you
|
||||||
|
have Facebook in your bookmarks or history cache). This behavior can be turned
|
||||||
|
off by removing "t" from your 'complete' option.
|
||||||
________________________________________________________________________________
|
________________________________________________________________________________
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -221,7 +221,7 @@ ____
|
|||||||
|
|
||||||
|
|
||||||
|\'cpt'| |\'complete'|
|
|\'cpt'| |\'complete'|
|
||||||
||'complete' 'cpt'|| charlist (default: slf)
|
||'complete' 'cpt'|| charlist (default: stlf)
|
||||||
____
|
____
|
||||||
Items which are completed at the [c]:open[c] prompts. Available items:
|
Items which are completed at the [c]:open[c] prompts. Available items:
|
||||||
|
|
||||||
@@ -231,7 +231,8 @@ Items which are completed at the [c]:open[c] prompts. Available items:
|
|||||||
*l* Firefox location bar entries (bookmarks and history sorted in an intelligent way)
|
*l* Firefox location bar entries (bookmarks and history sorted in an intelligent way)
|
||||||
*b* Bookmarks
|
*b* Bookmarks
|
||||||
*h* History
|
*h* History
|
||||||
*S* Suggest engines
|
*S* Search engine suggestions
|
||||||
|
*t* Open tabs
|
||||||
-------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------
|
||||||
|
|
||||||
The order is important, so [c]:set complete=bs[c] would list bookmarks first,
|
The order is important, so [c]:set complete=bs[c] would list bookmarks first,
|
||||||
|
|||||||
Reference in New Issue
Block a user