From af82dff75bfebe79b056ddae744f99d4fa499f38 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Wed, 1 Nov 2017 16:15:32 -0700 Subject: [PATCH] Fix error in .getLongTitle when editors have no path --- src/text-editor.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/text-editor.js b/src/text-editor.js index 4d7d94de0..033cea5d6 100644 --- a/src/text-editor.js +++ b/src/text-editor.js @@ -1059,11 +1059,11 @@ class TextEditor { let myPathSegments const openEditorPathSegmentsWithSameFilename = [] for (const textEditor of atom.workspace.getTextEditors()) { - const pathSegments = fs.tildify(textEditor.getDirectoryPath()).split(path.sep) if (textEditor.getFileName() === fileName) { + const pathSegments = fs.tildify(textEditor.getDirectoryPath()).split(path.sep) openEditorPathSegmentsWithSameFilename.push(pathSegments) + if (textEditor === this) myPathSegments = pathSegments } - if (textEditor === this) myPathSegments = pathSegments } if (openEditorPathSegmentsWithSameFilename.length === 1) return fileName