Add holding opt/alt for fast scrolling (#31056)

Fixes #14612

This was a feature I dearly missed from VSCode, so adding this helped me
migrate to Zed without disrupting my workflow. I found that `4.0` was a
nice goldilocks multiplier and felt close/the same as the speed in
VSCode.

Release Notes:

- Added faster scrolling in the editor while holding opt/alt
This commit is contained in:
Alistair Smith
2025-05-26 19:42:20 +00:00
committed by GitHub
parent ee415de45f
commit 5bafb2b160
3 changed files with 30 additions and 1 deletions
+11
View File
@@ -26,6 +26,7 @@ pub struct EditorSettings {
pub autoscroll_on_clicks: bool,
pub horizontal_scroll_margin: f32,
pub scroll_sensitivity: f32,
pub fast_scroll_sensitivity: f32,
pub relative_line_numbers: bool,
pub seed_search_query_from_cursor: SeedQuerySetting,
pub use_smartcase_search: bool,
@@ -406,6 +407,12 @@ pub struct EditorSettingsContent {
///
/// Default: 1.0
pub scroll_sensitivity: Option<f32>,
/// Scroll sensitivity multiplier for fast scrolling. This multiplier is applied
/// to both the horizontal and vertical delta values while scrolling. Fast scrolling
/// happens when a user holds the alt or option key while scrolling.
///
/// Default: 4.0
pub fast_scroll_sensitivity: Option<f32>,
/// Whether the line numbers on editors gutter are relative or not.
///
/// Default: false
@@ -745,6 +752,10 @@ impl Settings for EditorSettings {
"editor.mouseWheelScrollSensitivity",
&mut current.scroll_sensitivity,
);
vscode.f32_setting(
"editor.fastScrollSensitivity",
&mut current.fast_scroll_sensitivity,
);
if Some("relative") == vscode.read_string("editor.lineNumbers") {
current.relative_line_numbers = Some(true);
}