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

Support slash/backslash as path separator instead of platform-specific path separator #23214

Open
1 task done
Poldraunic opened this issue Jan 16, 2025 · 2 comments
Open
1 task done
Labels
bite-size small issues enhancement [core label] file finder Feedback for file management, navigation, etc platform support An umbrella label for all platforms

Comments

@Poldraunic
Copy link
Contributor

Check for existing issues

  • Completed

Describe the feature

In the environment where a lot of files have the same name but are in different folders it is handy to search for partial path. For example, C++ CMake build system uses a lot of CMakeLists.txt files for build targets (libraries, apps, tests, etc). This means project generally has more than a handful of these files.

Pretty much every sufficiently modern editor/IDE nowadays has File Finder like functionally which I use it most of the time when navigating around project. I've tested VS Code, Sublime Text, IntelliJ IDEA and Qt Creator and all of them are able to match files regardless of path separator.

Quick skim through the Zed sources revealed use of std::path::MAIN_SEPARATOR_STR which is platform dependant.

Zed Version and System Specs

Zed 0.168.2

If applicable, add mockups / screenshots to help present your vision of the feature

On the vcpkg repo I want to find portfile.cmake in the directory icu.

Native Separator Non-Native Separator
Image Image
@notpeter notpeter added file finder Feedback for file management, navigation, etc platform support An umbrella label for all platforms and removed triage labels Jan 17, 2025
@notpeter notpeter changed the title Do not use platform-specific path separator when matching files (e.g. in File Finder) Support slash/backslash as path separator instead of platform-specific path separator Jan 17, 2025
@notpeter
Copy link
Member

So to be explicit, your request is that both / and \ are supported as path separators regardless of which platform you are running Zed.

I wonder if this behavior makes sense universally or in a subset of:

  • 'File Finder' (cmd-p) - Your suggestion
  • Global Find in Files (include/exclude globs)
  • Open/Save As (with fallback picker use_system_path_prompts)
  • Project Panel: Create new file: a/b/c/file.txt and a\b\c\file.txt
  • Assistant /file picker

I can confirm that other editors (Sublime Text, VSCode, etc) on macOS allow using \ as a path separator in the file finder and project search include/exclude which surprised me.

@Poldraunic
Copy link
Contributor Author

Poldraunic commented Jan 19, 2025

This seems maybe related:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bite-size small issues enhancement [core label] file finder Feedback for file management, navigation, etc platform support An umbrella label for all platforms
Projects
None yet
Development

No branches or pull requests

2 participants