mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-01-03 07:14:13 +01:00
Context-specific completer options. Option refactoring.
New review Owner: dougkearns Hopefully the changeset hash will actually be linked this time. If not, it's the tip of the testing branch, presumably r4161. I've been meaning to do this for a while. It allows case matching, sorting, and auto completion options to be assigned on a per context basis, with fine grained control. It also adds builtin regex support to options since it's used fairly extensively. There are definitely other options that would benefit from the regexlist type, if I can dig them up. The interface (and perhaps the doc wording) is the only place I'm really ambivalent. --HG-- branch : testing
This commit is contained in:
@@ -240,7 +240,7 @@ const File = Class("File", {
|
||||
*/
|
||||
MODE_EXCL: 0x80,
|
||||
|
||||
expandPathList: function (list) list.split(",").map(this.expandPath).join(","),
|
||||
expandPathList: function (list) list.map(this.expandPath),
|
||||
|
||||
expandPath: function (path, relative) {
|
||||
|
||||
@@ -1028,8 +1028,8 @@ lookup:
|
||||
b.isdir - a.isdir || String.localeCompare(a.text, b.text);
|
||||
|
||||
if (options["wildignore"]) {
|
||||
let wigRegexp = RegExp("(^" + options.get("wildignore").values.join("|") + ")$");
|
||||
context.filters.push(function ({item: f}) f.isDirectory() || !wigRegexp.test(f.leafName));
|
||||
let wig = options.get("wildignore");
|
||||
context.filters.push(function ({item: f}) f.isDirectory() || !wig.getKey(this.name));
|
||||
}
|
||||
|
||||
// context.background = true;
|
||||
@@ -1099,6 +1099,10 @@ lookup:
|
||||
options.add(["shellcmdflag", "shcf"],
|
||||
"Flag passed to shell when executing :! and :run commands",
|
||||
"string", shellcmdflag);
|
||||
|
||||
options.add(["wildignore", "wig"],
|
||||
"List of file patterns to ignore when completing files",
|
||||
"regexlist", "");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user