mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-02-10 17:35:45 +01: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
|
||||
// -> see util.stringToURLArray for more details
|
||||
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);
|
||||
}
|
||||
|
||||
if (urls.length > 20 && !force)
|
||||
{
|
||||
|
||||
@@ -645,6 +645,10 @@ function Tabs() //{{{
|
||||
{ argCount: "0" });
|
||||
}
|
||||
|
||||
completion.addUrlCompleter("t",
|
||||
"Open tabs",
|
||||
completion.buffer);
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////}}}
|
||||
////////////////////// PUBLIC SECTION //////////////////////////////////////////
|
||||
/////////////////////////////////////////////////////////////////////////////{{{
|
||||
|
||||
@@ -770,7 +770,7 @@ function CommandLine() //{{{
|
||||
|
||||
options.add(["complete", "cpt"],
|
||||
"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)],
|
||||
validator: Option.validateCompleter
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
2009-XX-XX:
|
||||
* version 2.2a1pre
|
||||
* IMPORTANT: the 'complete' option's default has changed (again) to "stlf"
|
||||
* IMPORTANT: Map.flags has been replaced with individual properties.
|
||||
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>
|
||||
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]
|
||||
* make [c]:open[c] behavior match that of [c]:tabopen[c] and [c]:winopen[c]
|
||||
when no argument is specified
|
||||
|
||||
@@ -34,6 +34,7 @@ const config = { //{{{
|
||||
/*** optional options, there are checked for existence and a fallback provided ***/
|
||||
features: ["bookmarks", "hints", "history", "marks", "quickmarks", "session", "tabs", "tabs_undo", "windows"],
|
||||
defaults: {
|
||||
complete: "stlf",
|
||||
guioptions: "rb",
|
||||
showtabline: 2,
|
||||
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.
|
||||
The items which are completed on [m]<Tab>[m] are specified in the 'complete'
|
||||
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'|
|
||||
||'complete' 'cpt'|| charlist (default: slf)
|
||||
||'complete' 'cpt'|| charlist (default: stlf)
|
||||
____
|
||||
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)
|
||||
*b* Bookmarks
|
||||
*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,
|
||||
|
||||
Reference in New Issue
Block a user