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

Show path in file picker and explorer #12806

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

Conversation

paholg
Copy link

@paholg paholg commented Feb 7, 2025

The file picker and explorer can each be opened in several ways, each causing it to have a different root path. What's more, the file explorer can change its path while you have it open.

This can make it very difficult to keep track of the root directory for these pickers, so we add it as a header.

If desired, we could alternatively make this a configuration option, but I see little downside to always including it.

Example:

2025-02-07_01 51 46-w

The file picker and explorer can each be opened in several ways, each
causing it to have a different root path. What's more, the file explorer
can change its path while you have it open.

This can make it very difficult to keep track of the root directory for
these pickers, so we add it as a header.

If desired, we could alternatively make this a configuration option, but
I see little downside to always including it.
@nik-rev
Copy link
Contributor

nik-rev commented Feb 8, 2025

@David-Else is this what you were talking about when you said where the path of the pickers should be? The path is directly above the items, replacing the usual picker column headers. I actually really like this idea!

@@ -235,7 +235,7 @@ pub fn file_picker(root: PathBuf, config: &helix_view::editor::Config) -> FilePi
log::debug!("file_picker init {:?}", Instant::now().duration_since(now));

let columns = [PickerColumn::new(
"path",
root.to_string_lossy(),
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of showing the absolute path, I think it'd be cleaner to show the relative path. Using helix_stdx::path::get_relative_path

@nik-rev
Copy link
Contributor

nik-rev commented Feb 8, 2025

This PR also hides the path column header. That's potentially useful to keep. Any reasons for removing it?

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