Update getLongTitle to fall back to basename

Update getLongTitle to fall back to basename when the relative path
resolves to a blank string.
This commit is contained in:
Chris Pearson
2014-05-28 15:12:51 +01:00
parent a337384e7b
commit 61cb22840e

View File

@@ -260,6 +260,7 @@ class Editor extends Model
if sessionPath = @getPath()
fileName = path.basename(sessionPath)
directory = atom.project.relativize(path.dirname(sessionPath))
directory = if directory.length > 0 then directory else path.basename(path.dirname(sessionPath))
"#{fileName} - #{directory}"
else
'untitled'