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

Add TextEditor.getUniqueTitle() - #9024

Merged
nathansobo merged 1 commit into
atom:masterfrom
EasyHard:unique-title
Nov 2, 2015
Merged

nathansobo merged 1 commit into
atom:masterfrom
EasyHard:unique-title

Conversation

@EasyHard

@EasyHard EasyHard commented Oct 2, 2015

Copy link
Copy Markdown
Contributor

This PR tries to address issue #7345

This method is intended to replace TextEditor.getLongTitle
and gives a better tab title when there are multiple opened
files have identical file name. It will returns
/.../ when opened files
have identical file name. With this PR and updating atom/tabs
multiple files with identical name will look like this.

image

This method is intended to replace TextEditor.getLongTitle
and gives a better tab title when there are multiple opened
files has identical file name. This method will returns

<unique-parent-directory>/.../<filename> when opened files
have identical file name.
Comment thread src/text-editor.coffee

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean by sessionPath in this case?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably absolutePath is a better name. this.getPath will return absolute path of the current buffer if I understand correctly.

@nathansobo

Copy link
Copy Markdown
Contributor

Hey @EasyHard, thanks a lot. This looks like a much nicer approach to building a unique title for the tabs when files have the same name. I have a couple clarifying questions. After those get clarified, I can get this caught up with master and inject the workspace dependency (we're trying to avoid using globals in core). Then we can start using this in packages. Thanks again.

@EasyHard

Copy link
Copy Markdown
Contributor Author

Hi @nathansobo . Thanks a lot. I add some comments according to your questions. Please ping me if I did not put myself clearly. And by the way, your effort of improving atom's testing environments is awesome. Easier testing will definitely make Atom more attractive.

@nathansobo
nathansobo merged commit b9f0445 into atom:master Nov 2, 2015
nathansobo pushed a commit that referenced this pull request Nov 2, 2015
@nathansobo

Copy link
Copy Markdown
Contributor

Thanks @EasyHard. I made some minor updates to the local variables and rebased. This PR will need to make its way into a release before we can use it in packages.

@DouweM

DouweM commented Nov 16, 2015

Copy link
Copy Markdown
Contributor

Any reason why we don't just change getLongTitle to get this unique title, so that we don't need to change the call in packages?

@nathansobo

Copy link
Copy Markdown
Contributor

@DouweM, Good idea. Changed on the beta branch (af22a14). Heads up @EasyHard that getUniqueTitle will be gone in the next beta hotfix update.

@Ben3eeE

Ben3eeE commented Aug 30, 2016

Copy link
Copy Markdown
Contributor

@nathansobo What happened to this? I still see the old format on tab names.

@nathansobo

Copy link
Copy Markdown
Contributor

I'm actually not sure. Maybe you could pickaxe the git history?

@Ben3eeE

Ben3eeE commented Aug 30, 2016

Copy link
Copy Markdown
Contributor

I found it, this version only lived for a few releases and was replaced in/around 1.3.3 with #9636.

Shame cause this looks better than the current. Looks like the images in #9636 does not use the format described in this PR? I don't know what happened, also the last comment in #9636 is confused as well.

Tag with change.
https://github.com/atom/atom/blob/v1.3.3/src/text-editor.coffee

@lee-dohm

Copy link
Copy Markdown
Contributor

@Ben3eeE This PR caused a crashing bug: #10043. This is why the behavior was essentially reverted.

@Ben3eeE

Ben3eeE commented Aug 31, 2016

Copy link
Copy Markdown
Contributor

@lee-dohm I see. Maybe #7345 can be closed? The current look is similar to what it was before #9636 but still improved over what it was before this.

I found atom/tabs#256 which sounds like what I really want. That way I can make whatever look I feel like!

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.

7 participants