1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-30 21:22:28 +01:00

file completion now works for the path '/' also

This commit is contained in:
Viktor Kojouharov
2007-04-22 23:56:24 +00:00
parent f7681aff1f
commit 33418f2473

View File

@@ -191,11 +191,11 @@ function get_file_completions(filter)/*{{{*/
var fd = fopen(dir, "<");
if (!fd) return [];
var entries = fd.read();
var delim = (fd.path.search(/\\/) != -1) ? "\\" : "/";
var delim = fd.path.length == 1 ? '' : (fd.path.search(/\\/) != -1) ? "\\" : "/";
var reg = new RegExp("^" + fd.path + delim + compl);
entries.forEach(function(file) {
if (file.path.search(reg) != -1)
g_completions.push([file.path]);
g_completions.push([file.path, '']);
});
return g_completions;