mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-03-25 03:43:31 +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, "<");
|
var fd = fopen(dir, "<");
|
||||||
if (!fd) return [];
|
if (!fd) return [];
|
||||||
var entries = fd.read();
|
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);
|
var reg = new RegExp("^" + fd.path + delim + compl);
|
||||||
entries.forEach(function(file) {
|
entries.forEach(function(file) {
|
||||||
if (file.path.search(reg) != -1)
|
if (file.path.search(reg) != -1)
|
||||||
g_completions.push([file.path]);
|
g_completions.push([file.path, '']);
|
||||||
});
|
});
|
||||||
|
|
||||||
return g_completions;
|
return g_completions;
|
||||||
|
|||||||
Reference in New Issue
Block a user