mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-01-06 05:04:11 +01:00
Don't bother forking colorscheme completion.
It was an attempt to improve on Vim's colorscheme completion, across multiple runtime paths, but that's more buggy than useful.
This commit is contained in:
@@ -1426,15 +1426,17 @@ function Completion() //{{{
|
|||||||
|
|
||||||
colorScheme: function colorScheme(context)
|
colorScheme: function colorScheme(context)
|
||||||
{
|
{
|
||||||
// TODO: use path for the description?
|
let colors = [];
|
||||||
|
|
||||||
io.getRuntimeDirectories("colors").forEach(function (dir) {
|
io.getRuntimeDirectories("colors").forEach(function (dir) {
|
||||||
context.fork(dir.path, 0, null, function (context) {
|
io.readDirectory(dir).forEach(function (file) {
|
||||||
context.filter = dir.path + io.pathSeparator + context.filter;
|
if (/\.vimp$/.test(file.leafName) && !colors.some(function (c) c.leafName == file.leafName))
|
||||||
completion.file(context);
|
colors.push(file);
|
||||||
context.title = ["Color Scheme"];
|
|
||||||
context.quote = ["", function (text) text.replace(/\.vimp$/, ""), ""];
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
context.title = ["Color Scheme", "Runtime Path"];
|
||||||
|
context.completions = [[c.leafName.replace(/\.vimp$/, ""), c.parent.path] for ([,c] in Iterator(colors))]
|
||||||
},
|
},
|
||||||
|
|
||||||
command: function command(context)
|
command: function command(context)
|
||||||
|
|||||||
Reference in New Issue
Block a user