Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disambiguate buffer names #29

Merged
merged 2 commits into from
Jul 15, 2019
Merged

Disambiguate buffer names #29

merged 2 commits into from
Jul 15, 2019

Conversation

chunkhang
Copy link
Collaborator

We keep track of buffer head and tail, which is basically the
directory and basename. We start off with just the tail as the buffer
name. If there are multiple occurrences of the same name, we prepend
tail with the last element from head. We keep using more and more
elements from head until all buffer names are unique. New buffers are
not included in the disambiguate process.

We keep track of buffer `head` and `tail`, which is basically the
directory and basename. We start off with just the `tail` as the buffer
`name`. If there are multiple occurrences of the same `name`, we prepend
`tail` with the last element from `head`. We keep using more and more
elements from `head` until all buffer names are unique. New buffers are
not included in the disambiguate process.
@chunkhang chunkhang requested a review from bagrat July 12, 2019 16:46
@chunkhang
Copy link
Collaborator Author

In regards to #25

Copy link
Owner

@bagrat bagrat left a comment

Choose a reason for hiding this comment

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

Just tested this and it works perfect 👍 it is just that the update grows too long and the code is not that readable. Maybe we can at least break these additions into functions to that we can then more easily refactor them, what do you think @chunkhang?

@chunkhang
Copy link
Collaborator Author

Just tested this and it works perfect +1 it is just that the update grows too long and the code is not that readable. Maybe we can at least break these additions into functions to that we can then more easily refactor them, what do you think @chunkhang?

Sure, I'll do that. However, after this, we should really be looking at reworking how we store and manage the existing buffer list. Using the right approach should solve #24.

@bagrat
Copy link
Owner

bagrat commented Jul 15, 2019

However, after this, we should really be looking at reworking how we store and manage the existing buffer list.

totally 👍

@bagrat
Copy link
Owner

bagrat commented Jul 15, 2019

@chunkhang I have created a separate issue for the refactor #32, so let's not block this feature and merge it right away.

@bagrat bagrat merged commit 6dc5a56 into master Jul 15, 2019
@chunkhang chunkhang deleted the disambiguate-buffer branch July 17, 2019 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants