From af22a149bdd8989f5c279863ff319bdc652d7c66 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Mon, 16 Nov 2015 13:47:23 -0800 Subject: [PATCH] Replace getLongTitle with getUniqueTitle --- src/text-editor.coffee | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/src/text-editor.coffee b/src/text-editor.coffee index e5b3bd481..29d56c6c8 100644 --- a/src/text-editor.coffee +++ b/src/text-editor.coffee @@ -586,18 +586,18 @@ class TextEditor extends Model else 'untitled' - # Essential: Get unique title for display in other parts of the UI - # such as the window title. + # Essential: Get unique title for display in other parts of the UI, such as + # the window title. # # If the editor's buffer is unsaved, its title is "untitled" # If the editor's buffer is saved, its unique title is formatted as one # of the following, # * "" when it is the only editing buffer with this file name. # * "/.../", where the "..." may be omitted - # if the the direct parent directory is already different. + # if the the direct parent directory is already different. # # Returns a {String} - getUniqueTitle: -> + getLongTitle: -> if sessionPath = @getPath() title = @getTitle() @@ -625,22 +625,6 @@ class TextEditor extends Model else 'untitled' - # Essential: Get the editor's long title for display in other parts of the UI - # such as the window title. - # - # If the editor's buffer is saved, its long title is formatted as - # " - ". If it is unsaved, its title is "untitled" - # - # Returns a {String}. - getLongTitle: -> - if sessionPath = @getPath() - fileName = path.basename(sessionPath) - directory = @project.relativize(path.dirname(sessionPath)) - directory = if directory.length > 0 then directory else path.basename(path.dirname(sessionPath)) - "#{fileName} - #{directory}" - else - 'untitled' - # Essential: Returns the {String} path of this editor's text buffer. getPath: -> @buffer.getPath()