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