From 79ef0f67eb89d240f448afa614d5ffee5048088f Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Wed, 18 Mar 2009 20:32:41 +1100 Subject: [PATCH] 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. --- common/content/completion.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/common/content/completion.js b/common/content/completion.js index ee86368d..5c8e9d2d 100644 --- a/common/content/completion.js +++ b/common/content/completion.js @@ -1426,15 +1426,17 @@ function Completion() //{{{ colorScheme: function colorScheme(context) { - // TODO: use path for the description? + let colors = []; + io.getRuntimeDirectories("colors").forEach(function (dir) { - context.fork(dir.path, 0, null, function (context) { - context.filter = dir.path + io.pathSeparator + context.filter; - completion.file(context); - context.title = ["Color Scheme"]; - context.quote = ["", function (text) text.replace(/\.vimp$/, ""), ""]; + 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))] }, command: function command(context)