Avoid generating a duplicate !ig suggestion

This commit is contained in:
Ivan Kozik 2015-04-25 11:28:02 +00:00
parent 9721b8e82b
commit 8b55d0c20c

View File

@ -1225,6 +1225,10 @@ ContextMenuRenderer.prototype.makeCopyTextFn = function(text) {
ContextMenuRenderer.prototype.getPathVariants = function(path) {
var paths = [path];
// Avoid generating a duplicate suggestion
path = path.replace(/\/$/, "");
while(path.lastIndexOf('/') > 0) {
path = path.replace(/\/[^\/]*$/, "");
paths.push(path + '/');