editor: Add sticky scroll (#42242)

Closes #5344


https://github.com/user-attachments/assets/37ec58b0-7cf6-4eea-9b34-dccf03d3526b

Release Notes:

- Added a setting to stick scopes to the top of the editor

---------

Co-authored-by: KyleBarton <kjb@initialcapacity.io>
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
This commit is contained in:
Tim Vermeulen
2025-11-10 11:24:30 -07:00
committed by GitHub
co-authored by KyleBarton Conrad Irwin
parent d896af2f15
commit aa6270e658
10 changed files with 773 additions and 7 deletions
+15
View File
@@ -1352,6 +1352,21 @@ pub(crate) fn settings_data(cx: &App) -> Vec<SettingsPage> {
metadata: None,
files: USER,
}),
SettingsPageItem::SettingItem(SettingItem {
title: "Sticky Scroll",
description: "Whether to stick scopes to the top of the editor",
field: Box::new(SettingField {
json_path: Some("sticky_scroll.enabled"),
pick: |settings_content| {
settings_content.editor.sticky_scroll.as_ref().and_then(|sticky_scroll| sticky_scroll.enabled.as_ref())
},
write: |settings_content, value| {
settings_content.editor.sticky_scroll.get_or_insert_default().enabled = value;
},
}),
metadata: None,
files: USER,
}),
SettingsPageItem::SectionHeader("Signature Help"),
SettingsPageItem::SettingItem(SettingItem {
title: "Auto Signature Help",