mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-23 16:12:26 +01:00
Add 'wildcase' option
This commit is contained in:
3
NEWS
3
NEWS
@@ -16,6 +16,9 @@
|
||||
* IMPORTANT: renamed Startup and Quit autocmd events to VimperatorEnter and
|
||||
VimperatorLeave respectively
|
||||
|
||||
* add 'wildcase' option
|
||||
* 'linkbgcolor', 'linkfgcolor', ... have been replaced with highlight
|
||||
groups, HintElem and HintActive
|
||||
* new 'followhints' option
|
||||
* :buffers supports a filter now to only list buffers matching filter (vim
|
||||
incompatible, but consistent with other commands)
|
||||
|
||||
@@ -56,6 +56,7 @@ function CompletionContext(editor, name, offset)
|
||||
self.keys = util.cloneObject(parent.keys);
|
||||
delete self._generate;
|
||||
delete self._filter; // FIXME?
|
||||
delete self._ignoreCase;
|
||||
["anchored", "compare", "editor", "filterFunc", "keys", "_process", "quote", "title", "top"].forEach(function (key)
|
||||
self[key] = parent[key]);
|
||||
if (self != this)
|
||||
@@ -208,7 +209,11 @@ CompletionContext.prototype = {
|
||||
},
|
||||
|
||||
get filter() this._filter != null ? this._filter : this.value.substr(this.offset, this.caret),
|
||||
set filter(val) this._filter = val,
|
||||
set filter(val)
|
||||
{
|
||||
delete this._ignoreCase;
|
||||
return this._filter = val
|
||||
},
|
||||
|
||||
get format() ({
|
||||
title: this.title,
|
||||
@@ -222,8 +227,18 @@ CompletionContext.prototype = {
|
||||
this.process = format.process || this.process;
|
||||
},
|
||||
|
||||
// XXX
|
||||
get ignoreCase() this.filter == this.filter.toLowerCase(),
|
||||
get ignoreCase()
|
||||
{
|
||||
if ("_ignoreCase" in this)
|
||||
return this._ignoreCase;
|
||||
let mode = options["wildcase"];
|
||||
if (mode == "match")
|
||||
return this._ignoreCase = false;
|
||||
if (mode == "ignore")
|
||||
return this._ignoreCase = true;
|
||||
return this._ignoreCase = !/[A-Z]/.test(this.filter);
|
||||
},
|
||||
set ignoreCase(val) this._ignoreCase = val,
|
||||
|
||||
get items()
|
||||
{
|
||||
@@ -318,6 +333,7 @@ CompletionContext.prototype = {
|
||||
|
||||
advance: function advance(count)
|
||||
{
|
||||
delete this._ignoreCase;
|
||||
this.offset += count;
|
||||
if (this.quote)
|
||||
{
|
||||
|
||||
@@ -435,15 +435,6 @@ function CommandLine() //{{{
|
||||
////////////////////// OPTIONS /////////////////////////////////////////////////
|
||||
/////////////////////////////////////////////////////////////////////////////{{{
|
||||
|
||||
// TODO: doesn't belong in ui.js
|
||||
options.add(["complete", "cpt"],
|
||||
"Items which are completed at the :[tab]open prompt",
|
||||
"charlist", "sfl",
|
||||
{
|
||||
completer: function completer(filter) [k for each (k in completion.urlCompleters)],
|
||||
validator: options.validateCompleter
|
||||
});
|
||||
|
||||
options.add(["history", "hi"],
|
||||
"Number of Ex commands and search patterns to store in the command-line history",
|
||||
"number", 500,
|
||||
@@ -478,6 +469,27 @@ function CommandLine() //{{{
|
||||
validator: options.validateCompleter
|
||||
});
|
||||
|
||||
// TODO: these belong in ui.js
|
||||
options.add(["complete", "cpt"],
|
||||
"Items which are completed at the :[tab]open prompt",
|
||||
"charlist", "sfl",
|
||||
{
|
||||
completer: function completer(filter) [k for each (k in completion.urlCompleters)],
|
||||
validator: options.validateCompleter
|
||||
});
|
||||
|
||||
options.add(["wildcase", "wic"],
|
||||
"Completion case matching mode",
|
||||
"string", "smart",
|
||||
{
|
||||
completer: function () [
|
||||
["smart", "Case is significant when capital letters are typed"],
|
||||
["match", "Case is always significant"],
|
||||
["ignore", "Case is never significant"]
|
||||
],
|
||||
validator: options.validateCompleter
|
||||
});
|
||||
|
||||
options.add(["wildignore", "wig"],
|
||||
"List of file patterns to ignore when completing files",
|
||||
"stringlist", "",
|
||||
|
||||
@@ -308,6 +308,7 @@ section:Options[option-index]
|
||||
||'usermode'|| Show current website with a minimal style sheet to make it easily accessible +
|
||||
||'verbose'|| Define which info messages are displayed +
|
||||
||'visualbell'|| Use visual bell instead of beeping on errors +
|
||||
||'wildcase'|| Completion case matching mode +
|
||||
||'wildignore'|| List of file patterns to ignore when completing files +
|
||||
||'wildmode'|| Define how command-line completion works +
|
||||
||'wildoptions'|| Change how command-line completion is done +
|
||||
|
||||
@@ -743,6 +743,19 @@ this option.
|
||||
____
|
||||
|
||||
|
||||
|\'wildcase'| |\'wic'|
|
||||
||'wildcase' 'wic'|| string (default: "smart")
|
||||
____
|
||||
Defines how completions are matched with regard to character case.
|
||||
|
||||
`---------------`------------------------
|
||||
"smart" Case is significant when capital letters are typed
|
||||
"match" Case is always significant
|
||||
"ignore" Case is never significant
|
||||
-----------------------------------------
|
||||
____
|
||||
|
||||
|
||||
|\'wildignore'| |\'wig'|
|
||||
||'wildignore' 'wig'|| stringlist (default: "")
|
||||
____
|
||||
|
||||
@@ -30,15 +30,29 @@ Valid groups are:
|
||||
`------------------`-----------------------------------
|
||||
*Bell* Vimperator's visual bell
|
||||
*Boolean* A JavaScript Boolean object
|
||||
*CompDesc* The description column of the completion list
|
||||
*CompIcon* The favicon of a completion row
|
||||
*CompItem* A completion row
|
||||
*CompLess* The indicator shown when completions may be scrolled up
|
||||
*CompMore* The indicator shown when completions may be scrolled down
|
||||
*CompResult* The result column of the completion list
|
||||
*CompTitle* Completion row titles
|
||||
*ErrorMsg* Error messages
|
||||
*Filter* The matching text in a completion list
|
||||
*FrameIndicator* The indicator shown when a new frame is selected
|
||||
*Function* A JavaScript Function object
|
||||
*Hint* A hint indicator. See [c]:help hints[c].
|
||||
*HintActive* The hint element which will be selected on <Enter>
|
||||
*HintElem* The element which a hint refers to.
|
||||
*HintImage* The indicator which floats above hinted images.
|
||||
*Indicator*
|
||||
*InfoMsg* Information messages
|
||||
*Keyword* A bookmark keyword for a URL
|
||||
*LineNr* The line number of an error
|
||||
*Message*
|
||||
*ModeMsg* The mode indicator in the command line
|
||||
*MoreMsg* The indicator that there is more text to view
|
||||
*NonText*
|
||||
*Normal* Normal text in the command line
|
||||
*Null* A JavaScript Null object
|
||||
*Number* A JavaScript Number object
|
||||
|
||||
Reference in New Issue
Block a user