Skip to content
This repository was archived by the owner on Mar 3, 2023. It is now read-only.

Use unique text editor title in window and tab titles - #9636

Merged
maxbrunsfeld merged 3 commits into
atom:masterfrom
DouweM:unique-title
Nov 21, 2015
Merged

maxbrunsfeld merged 3 commits into
atom:masterfrom
DouweM:unique-title

Conversation

@DouweM

@DouweM DouweM commented Nov 16, 2015

Copy link
Copy Markdown
Contributor

I have two files, app/services/notes/create_service.rb and app/services/issues/create_service.rb.

Right now it's impossible to find which is which using either the window or tab title:

screen shot 2015-11-16 at 20 16 02

screen shot 2015-11-16 at 20 16 10

With these changes, it is:

screen shot 2015-11-16 at 20 18 28

screen shot 2015-11-16 at 20 18 36

Both now use <item>::getLongTitle which delegates to TextEditor::getUniqueTitle in the case of TextEditor items.

Besides this, TextEditor::getUniqueTitle was modified to match Sublime Text's behavior, where features/index.html, features/main/index.html and contact/index.html will show as index.html — features, index.html — features/main and index.html — contact rather than features/index.html — features, features/.../index.html and features/index.html. With the original implementation, the difference between the first two would still be difficult to spot, and the actual filename could be pushed out of the tab if the directory names were especially long.

PS. I used em-dashes rather than 'normal' dashes since this was developed in conjunction with #9620.

@DouweM

DouweM commented Nov 17, 2015

Copy link
Copy Markdown
Contributor Author

Once af22a14 lands in master, I will move getUniqueTitle to getLongTitle.

@DouweM
DouweM force-pushed the unique-title branch 2 times, most recently from 6abe41f to 6263938 Compare November 18, 2015 15:54
@DouweM

DouweM commented Nov 19, 2015

Copy link
Copy Markdown
Contributor Author

@benogle Anything I can do to help this PR along?

@benogle

benogle commented Nov 20, 2015

Copy link
Copy Markdown
Contributor

cc @maxbrunsfeld

@maxbrunsfeld

Copy link
Copy Markdown
Contributor

Thanks for improving this. Your algorithm is easier to understand than the old one too 👍.

maxbrunsfeld pushed a commit that referenced this pull request Nov 21, 2015
Use unique text editor title in window and tab titles
@maxbrunsfeld
maxbrunsfeld merged commit 30b3cb2 into atom:master Nov 21, 2015
maxbrunsfeld pushed a commit that referenced this pull request Jan 8, 2016
Use unique text editor title in window and tab titles
@mik01aj

mik01aj commented Jan 27, 2016

Copy link
Copy Markdown

I wonder why you were seeing:

create_service.rb - app/service/......  |  create_service.rb - app/service/......

Because in such situations, I normally saw:

notes/create_service.rb  |  issues/create_service.rb

...which was imho way better (It is a big difference when I have a lot of open tabs!). I recently upgraded and I now see:

create_service.rb - notes  |  create_service.rb - issues

I don't like the change. Is there any way to get the old behaviour back?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants