Differentiate opened file with the same name but in different folders


#1

When different files with the same name (but in different folders) are opened there is no easy way to tell which ones is which by looking at the title in the tabs.
In Sublime Text this differentiation is achieved by prepending the path to the file to the names of the same-name files in the tab.
It would be nice to replicate this feature in Atom


#2

It already does this for me…


#3

sorry, you are right.
I wasn’t clear enough, with “path” I meant the full path from the root of the project:

here is atom:

(I’ll put the same scenario in sublime in the next post, since the new users can put just one image per message)


#4

And here’s sublime:


#5

Can you open an issue here? https://github.com/atom/tabs/issues

There, the devs can take a look at this problem.


#6

Or better yet, fix the problem and submit a PR.


#7

I’d like to able to fix it, but I’m afraid it is currently beyond my capability :blush: I’ll open the issue as @AbeEstrada suggested.


#8

Here it is: https://github.com/atom/tabs/issues/57

thank you


#9

Not a js/coffee person but I don’t actually think it’s the tab at fault. This just displays @item.getLongTitle() if there are multiple files with the same name.

I just cant figure out what @item is, as I said not a js/coffee guy. I think it’s large-file but not 100%. If so it would appear a call to path.relative is required from the project root rather then stripping the dir structure.


#10

Actually it appears to be editor.coffee in atom/atom

edit: I think I have a fix that should work, however I cannot build atom at work due to an overzealous firewall. Will try it out this evening and, if it works, create a pull request against atom/atom.

Will I need to create a new issue against atom as the change is there not in tabs?


#11

No, you can always reference the Issue in Tabs from your pull request …

See “Closing issues across repositories” …

https://help.github.com/articles/closing-issues-via-commit-messages


#12

Just to clarify when I commit my fix into my branch I would put “Fixes atom/tabs#57” somewhere sensible and when that hits atom/atom master it would close the issue?

Just the docs state for pull request closing:

By including the “closed” keywords into the description of your Pull Requests
Does this mean any of the list (ie fixes, resolved, closes etc) or just closed specifically.


#13

I’d just put “Applies to atom/tabs#57” and then the owner of the repo can close it whenever they choose.

Or you can close it since it is an issue with Atom Core. The possibilities are endless! :laughing:

Any of the keywords listed in the help doc will close an issue. Though since the pull request is on a repository that is not the Tabs repository, I don’t think it’ll close it.

Hope all of that helps :laughing:


#14

Submitted a PR just now to atom/atom. My first ever to any OS project and was ably assisted by one of my 18 week old twins.


#15

From what I can tell from the linked github issues, this change was merged into v.0.100.0, but now at v.0.177.0 I still find the tab titles for identically named files to be useless compared for instance to Sublime.

I have the following file structure for theme’s config files in a project:

/src/themes/apex/config.php
/src/themes/pinnacle/config.php
/src/themes/pioneer/config.php
/src/themes/hotshot/config.php
… etc

There are many themes, and when I open multiple config.php-files, the file tabs are identical in Atom, but very accurately named in for instance Sublime Text. Look at this comparison:

Did I miss something here? Do I have to enable sensible tab names somewhere? :smile:


#16

I bring tiding of great joy that will be to all people for born this day in the Atom Plugins is a life saving plugin, which will be to all people. You will find this plugin titled, atom-tab-foldername located https://github.com/Connormiha/atom-tab-foldername-index/tree/master/menus … and this shall be a sign for you, when you have multiple files with the same name open they shall be appended with the folder name.

Alternatively, try this guy out: https://atom.io/packages/foldername-tabs