e: determine server name with two directory components instead of one

This commit is contained in:
Josh Holtrop 2018-12-05 14:07:27 -05:00
parent cf0b120ae7
commit 84c7b6a20b

6
e
View File

@ -9,7 +9,11 @@ def get_server_name(path)
while path != "/" while path != "/"
dirname = File.dirname(path) dirname = File.dirname(path)
if File.exists?(File.join(dirname, "project.vim")) if File.exists?(File.join(dirname, "project.vim"))
sn = File.basename(dirname) + "1" if dirname =~ %r{([^/]+)/([^/]+)/*$}
sn = "#{$2}(#{$1})"
else
sn = File.basename(dirname)
end
return sn return sn
end end
path = dirname path = dirname