mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-01-04 04:14:12 +01:00
Add IO#File.
New review: owner: dougkearns I like this for the most part, except that it has to go to lengths to wrap the original nsIFile correctly, an that it can't be passed directly to other XPCOM components. It makes most operations on files a lot cleaner, though.
This commit is contained in:
@@ -825,17 +825,13 @@ liberator.registerObserver("load_completion", function () {
|
||||
]);
|
||||
|
||||
completion.colorScheme = function colorScheme(context) {
|
||||
let colors = [];
|
||||
|
||||
io.getRuntimeDirectories("colors").forEach(function (dir) {
|
||||
io.readDirectory(dir).forEach(function (file) {
|
||||
if (/\.vimp$/.test(file.leafName) && !colors.some(function (c) c.leafName == file.leafName))
|
||||
colors.push(file);
|
||||
});
|
||||
});
|
||||
|
||||
context.title = ["Color Scheme", "Runtime Path"];
|
||||
context.completions = [[c.leafName.replace(/\.vimp$/, ""), c.parent.path] for ([, c] in Iterator(colors))]
|
||||
context.keys = { text: function (f) f.leafName.replace(/\.vimp$/, ""), description: "parent.path" };
|
||||
context.completions = util.Array.flatten(
|
||||
io.getRuntimeDirectories("colors").map(
|
||||
function (dir) dir.readDirectory().filter(
|
||||
function (file) /\.vimp$/.test(file.leafName) && !colors.some(function (c) c.leafName == file.leafName))))
|
||||
|
||||
};
|
||||
|
||||
completion.highlightGroup = function highlightGroup(context) {
|
||||
|
||||
Reference in New Issue
Block a user