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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user