ZIm/docs/src
tims 8c92da45a9
terminal: Add scrollbar (#23256)
Closes #4798

This PR implements a scrollbar for the terminal by turning
`ScrollableHandle` into a trait, allowing us to implement a custom
scroll handle, `TerminalScrollHandle`. It works by converting terminal
lines into pixels that `ScrollableHandle` understands. When
`ScrollableHandle` provides a changed offset (e.g., when you drag the
scrollbar), we convert this pixel offset back into the number of lines
to scroll and update the terminal content accordingly.

While the current version works as expected, I believe the scrollbar's
offset updates could potentially be turned into an event. This event
could then be subscribed to in `TerminalView`, not needing to update the
terminal's offset in the `render` method as it might have performance
implications. Further ideas on this are welcome.

Preview:


https://github.com/user-attachments/assets/560f0aac-4544-4007-8f0b-8833386f608f

Todo:

- [x] Experiment with custom scrollbar responding to terminal mouse
scroll
- [x] Refactor existing scrollbar handle into a trait  
- [x] Update terminal to use the scrollbar trait instead of a custom
scrollbar implementation
- [x] Figure out how scrollbar events like mouse drag should notify the
terminal to update its state
- [x] Code clean up
- [x] Scrollbar hide setting for terminal

Release Notes:

- Added scrollbar to the terminal
2025-01-18 17:36:41 +01:00
..
assistant Add LM Studio support to the Assistant (#23097) 2025-01-14 20:41:58 +00:00
development windows: Make collab run on Windows (#23117) 2025-01-17 09:39:13 +02:00
extensions Use standard injection.language and injection.content captures (#22268) 2025-01-07 18:17:49 +00:00
languages docs: Add Shell Script language documentation (#23248) 2025-01-16 12:16:38 -05:00
additional-learning-materials.md update docs content (#11374) 2024-05-03 16:24:04 -06:00
channels.md Docs Party 2024 (#15876) 2024-08-09 13:37:54 -04:00
collaboration.md Clarify guests vs collaborators in project sharing docs (#22945) 2025-01-10 15:42:52 +00:00
completions.md docs: Improve dark mode syntax highlighting (#18002) 2024-09-18 09:14:03 -03:00
configuring-languages.md Add per-language settings show_completions_on_input and show_completion_documentation (#21722) 2024-12-09 11:53:50 -07:00
configuring-zed.md terminal: Add scrollbar (#23256) 2025-01-18 17:36:41 +01:00
development.md Remove community content from docs and point to zed.dev (#19895) 2024-10-29 09:44:58 -04:00
environment.md docs: Fix typo in environment documentation (#19164) 2024-10-13 16:47:09 -04:00
extensions.md docs: Add docs for defining slash commands in extensions (#16303) 2024-08-15 12:50:30 -04:00
fonts.md Fix casing of "macOS" (#17040) 2024-08-28 19:10:49 -04:00
getting-started.md docs: Improve the Getting Started page (#22545) 2025-01-01 17:19:10 +00:00
git.md docs: Update names of supported Git providers (#17436) 2024-09-05 13:42:49 -04:00
globs.md Glob documentation (#18789) 2024-10-15 17:21:04 -04:00
key-bindings.md Make use_key_equivalents opt-in (#21662) 2024-12-06 14:05:03 -07:00
languages.md docs: Add Shell Script language documentation (#23248) 2025-01-16 12:16:38 -05:00
linux.md Revert "linux: Fix saving file with root ownership (#22045)" (#23162) 2025-01-15 05:17:08 +00:00
multibuffers.md Fix a typo in the multi buffers documentation (#18535) 2024-09-30 15:28:46 +03:00
outline-panel.md docs: Add tweaks to the outline panel page (#18697) 2024-10-03 12:27:42 -03:00
remote-development.md docs: Ensure "Remote Projects" dialog keybinding is displayed (#22530) 2025-01-01 00:40:38 +00:00
repl.md docs: Add tweaks to the REPL page (#18000) 2024-09-18 07:34:39 -03:00
snippets.md Add minimal snippets documentation (#14992) 2024-07-22 21:18:39 -04:00
SUMMARY.md docs: Document context servers (#21170) 2024-11-25 11:05:14 -05:00
system-requirements.md Update macOS system requirements in docs (#22248) 2024-12-19 17:55:46 +00:00
tasks.md Allow splitting terminal items in the central pane group (#22088) 2024-12-16 19:23:01 +02:00
telemetry.md Stop sending data to Clickhouse (#21763) 2024-12-10 08:47:29 -07:00
themes.md docs: Example theme_overrides for docstrings as italic (#19694) 2024-10-24 14:37:57 -04:00
vim.md docs: Fix "copy" being used instead of "paste" in vim mode documentation (#23010) 2025-01-11 21:45:41 +00:00
windows.md Fix stale Discord invite links (#21074) 2024-11-22 21:10:51 +00:00