Repository navigation
Add setting to squash directories - #608
Conversation
A new setting tree-view.squashDirectoryNames that squashes directories
together when a directory only contains a single directory. Take the following
directory structure:
- foo
- bar
- file.txt
foo and bar would be merged in to a single DirectoryView:
- foo/bar
- file.txt
Notes:
- Squashing occurs recursively so multiple directories can be merged together.
- There is a loss of functionality when the squash is enabled since the
directories on the left are no longer available to right click. The
DirectoryView is treated as if it's the full directory.
- The style .squashed-dir was added to allow styling of the left portion of the
squashed directory ('foo/' in the above example).
- This feature is disabled by default.
Fixes #125
|
😍 |
|
So much awesomeness ⚡ |
There was a problem hiding this comment.
Could a test be added that would ensure that the platform-specific path separator is used? From what I've read, I can see that it currently does ... but I wouldn't want it to break in the future.
There was a problem hiding this comment.
I tried this approach to test that but it doesn't seem to work, I think because it breaks other calls to path like path.join in directory.coffee.
describe "when path.sep is overridden", ->
originalPathSep = path.sep
beforeEach ->
path.sep = '#'
afterEach ->
path.sep = originalPathSep
it "should use the overridden path.sep in the UI", ->
atom.project.setPaths([rootDirPath])
expect($(treeView.roots[0].entries).find('.directory:contains(alpha#beta):first')).toExist()Any ideas without exposing test a test-only function in directory.coffee?
There was a problem hiding this comment.
Actually, thinking more about this I feel like changing the other tests to use path.sep covers this. I'd prefer it to be more explicit as a form of documentation, but I also don't feel injecting a dependency just for the path separator here in this one spot is warranted.
Add setting to squash directories
|
Thanks for this! |
|
No problems, excited to see it land! |
|
Brilliant work! Thanks ❤️ |

A new setting tree-view.squashDirectoryNames that squashes directories
together when a directory only contains a single directory. Take the following
directory structure:
foo and bar would be merged in to a single DirectoryView:
Notes:
directories on the left are no longer available to right click. The
DirectoryView is treated as if it's the full directory.
squashed directory ('foo/' in the above example).
Fixes #125