mirror of
https://github.com/zed-industries/zed.git
synced 2026-05-27 00:08:42 +00:00
This PR introduces the `project_panel.scrollbar.horizontal_scroll` setting to allow users to toggle the horizontal scroll bar in the project panel. This was Zed's design before PR #18513, and the default behavior of VSCode (`workbench.list.horizontalScrolling`). https://github.com/user-attachments/assets/f633f4e4-a585-4494-8f48-df77c6aca418 ## Rationale Zed's design used to be the same as the default behavior of VSCode. I.e., no horizontal scrolling, and the view is always snapped to the left, with long file names clipped of. If you want to see the content that is out-of-frame, you'll need to drag the handle and expand the project panel. This could be problematic, especially for large repos with multiple levels of nested directories, as pointed out by issues #5550 and #7001. <img width="1398" height="992" alt="image" src="https://github.com/user-attachments/assets/d86563f2-0f06-4e9e-818c-155ac45f0f56" />\ *VSCode's default setup, for reference.* Then came PR #18513, which added horizontal scroll and addressed this pain point, but users didn't have a choice. They're stuck with horizontal scrolling always turned on. I, for instance, personally prefer the old, VSCode-default behavior, for most projects I open are small and don't need horizontal scrolling in the project panel. With horizontal scrolling always turned on, I find it annoying to have my project panel view accidentally scrolled to the middle, and I'll have to grab my mouse and scroll it back. It's also visually redundant. Thus, why not add an option like VSCode's `workbench.list.horizontalScrolling` and let users choose? I'd love to be able to, say, set a per-project override for the projects that need horizontal scrolling, while having it disabled by default. ## Extra Notes - I was originally thinking about using `ScrollbarAxes` from `src/editor_settings.rs` and make the option `project_panel.scrollbar.axes.horizontal` similar to the global editor scrollbar settings, but this option is specific to the project panel and it doesn't quite make sense to allow disabling vertical scrolling on the project panel, so I added a standalone option for it instead, similar to VSCode's `workbench.list.horizontalScrolling`. - I went the conservative route and set horizontal scrolling to enabled (current behavior) by default. Imo it might make more sense to disable it by default instead, similar to VSCode, but I'll leave this for the Zed team to decide. - I named it `horizontal_scroll` instead of `horizontal_scrolling` to be consistent with the adjacent setting `sticky_scroll`. - As for tests, I don't see tests for the scrollbar, so I didn't add any. I'd be glad to update the PR if anything is not inline with the project's requirements or conventions. --- Release Notes: - Added `project_panel.scrollbar.horizontal_scroll` setting to allow toggling horizontal scrolling in the project panel Signed-off-by: k4yt3x <i@k4yt3x.com> |
||
|---|---|---|
| .. | ||
| ai | ||
| collaboration | ||
| development | ||
| extensions | ||
| languages | ||
| migrate | ||
| reference | ||
| all-actions.md | ||
| appearance.md | ||
| authentication.md | ||
| command-palette.md | ||
| completions.md | ||
| configuring-languages.md | ||
| configuring-zed.md | ||
| debugger.md | ||
| dev-containers.md | ||
| development.md | ||
| diagnostics.md | ||
| editing-code.md | ||
| environment.md | ||
| extensions.md | ||
| finding-navigating.md | ||
| getting-started.md | ||
| git.md | ||
| globs.md | ||
| helix.md | ||
| icon-themes.md | ||
| installation.md | ||
| key-bindings.md | ||
| languages.md | ||
| linux.md | ||
| macos.md | ||
| multibuffers.md | ||
| outline-panel.md | ||
| performance.md | ||
| quick-start.md | ||
| remote-development.md | ||
| repl.md | ||
| running-testing.md | ||
| semantic-tokens.md | ||
| snippets.md | ||
| SUMMARY.md | ||
| tab-switcher.md | ||
| tasks.md | ||
| telemetry.md | ||
| terminal.md | ||
| themes.md | ||
| toolchains.md | ||
| troubleshooting.md | ||
| uninstall.md | ||
| update.md | ||
| vim.md | ||
| visual-customization.md | ||
| windows.md | ||
| worktree-trust.md | ||