From a337384e7b868a5a3f0769808fb992b1a57b7461 Mon Sep 17 00:00:00 2001 From: Chris Pearson Date: Thu, 22 May 2014 21:49:49 +0100 Subject: [PATCH 1/2] Update getLongTitle to be project relative --- src/editor.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/editor.coffee b/src/editor.coffee index 7c2c83b24..fb90f1896 100644 --- a/src/editor.coffee +++ b/src/editor.coffee @@ -259,7 +259,7 @@ class Editor extends Model getLongTitle: -> if sessionPath = @getPath() fileName = path.basename(sessionPath) - directory = path.basename(path.dirname(sessionPath)) + directory = atom.project.relativize(path.dirname(sessionPath)) "#{fileName} - #{directory}" else 'untitled' From 61cb22840eb5c85726f0ec01f1e13b38f848d441 Mon Sep 17 00:00:00 2001 From: Chris Pearson Date: Wed, 28 May 2014 15:12:51 +0100 Subject: [PATCH 2/2] Update getLongTitle to fall back to basename Update getLongTitle to fall back to basename when the relative path resolves to a blank string. --- src/editor.coffee | 1 + 1 file changed, 1 insertion(+) diff --git a/src/editor.coffee b/src/editor.coffee index fb90f1896..dfb5a7b5c 100644 --- a/src/editor.coffee +++ b/src/editor.coffee @@ -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'