From 33418f2473a18dbc17fcfb6a7346d349ab05521a Mon Sep 17 00:00:00 2001 From: Viktor Kojouharov Date: Sun, 22 Apr 2007 23:56:24 +0000 Subject: [PATCH] file completion now works for the path '/' also --- chrome/content/vimperator/completion.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chrome/content/vimperator/completion.js b/chrome/content/vimperator/completion.js index 101af0ec..e4adb041 100644 --- a/chrome/content/vimperator/completion.js +++ b/chrome/content/vimperator/completion.js @@ -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;