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

Print the root path relative to the initial root #758

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

9999years
Copy link
Contributor

@9999years 9999years commented Oct 11, 2023

Allow printing the root path (the top line in the tree view) as relative to the directory broot is launched in.

This is supported in the usual manners:

  • As a command-line argument --root-relative-path
  • As a config file option root-relative-path
  • As a verb :toggle_root_relative

Here's how it looks, showing a sub-directory of the launch directory:

image

And showing a sibling of the launch directory:

image

@Canop
Copy link
Owner

Canop commented Oct 11, 2023

Can you please explain what you want to achieve and why ?

@9999years
Copy link
Contributor Author

Yes, I'll mark it ready for review once I have an explanation :)

@9999years
Copy link
Contributor Author

Relative paths are nice and I want to see them instead of absolute paths most of the time.

I'm also developing a broot integration plugin for Neovim and I'm using a snapshot testing framework. However, I can't get the tests to pass locally and in CI because I'm running them in different directories. If I can just view relative paths this isn't a problem.

I could also patch the snapshot testing framework to be able to ignore specific regions of the screenshots, as I've proposed here, but I wouldn't like to have to manually draw out those regions.

PS Thank you very much for Broot, it's very nice!

@9999years 9999years marked this pull request as ready for review October 11, 2023 06:19
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.

2 participants