Show unique paths to disambiguate same file names (Re: #557)#1521
Merged
dzhou121 merged 8 commits intolapce:masterfrom Oct 15, 2022
Merged
Show unique paths to disambiguate same file names (Re: #557)#1521dzhou121 merged 8 commits intolapce:masterfrom
dzhou121 merged 8 commits intolapce:masterfrom
Conversation
Signed-off-by: Hanif Bin Ariffin <hanif.ariffin.4326@gmail.com>
Signed-off-by: Hanif Bin Ariffin <hanif.ariffin.4326@gmail.com>
Also reimplemented to always find some unique path. Signed-off-by: Hanif Bin Ariffin <hanif.ariffin.4326@gmail.com>
Signed-off-by: Hanif Bin Ariffin <hanif.ariffin.4326@gmail.com>
Signed-off-by: Hanif Bin Ariffin <hanif.ariffin.4326@gmail.com>
dzhou121
reviewed
Oct 14, 2022
| } | ||
| } | ||
|
|
||
| fn get_truncated_path(full_paths: &[PathBuf]) -> Vec<PathBuf> { |
Collaborator
There was a problem hiding this comment.
Is this PathBuf.parent()?
Contributor
Author
There was a problem hiding this comment.
Not quite, you can imagine it as consuming all the given Paths in parallel from left and right one Component of at a time. It stops when it finds a mismatching Components. Just a simple algorithm to find a short unique path to display. I can't find the algorithm that VSCode it using so this is the best I can think of.
hbina
commented
Oct 15, 2022
| path_layout, | ||
| Point::new( | ||
| rect.x1 + 5.0 + self.text_layout.layout.width() as f64 + 5.0, | ||
| path_layout.y_offset(size.height), |
Contributor
Author
There was a problem hiding this comment.
Not entirely sure this is correct because I think its not really aligned to center. IDK how this layout really works tho.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Based on the work from #557.
CHANGELOG.mdif this change could be valuable to users