editor: Do not panic on tab_size > 16, cap it at 128 (#38994)

Fixes ZED-1PT
Fixes ZED-1PW
Fixes ZED-1G2

Release Notes:

- Fixed Zed panicking when the `tab_size` is set higher than 16
This commit is contained in:
Lukas Wirth
2025-09-27 00:13:16 +02:00
committed by GitHub
parent 837f282f1e
commit fbdf5d4df4
4 changed files with 17 additions and 15 deletions
+2
View File
@@ -749,6 +749,7 @@ pub struct LanguageConfig {
pub hard_tabs: Option<bool>,
/// How many columns a tab should occupy.
#[serde(default)]
#[schemars(range(min = 1, max = 128))]
pub tab_size: Option<NonZeroU32>,
/// How to soft-wrap long lines of text.
#[serde(default)]
@@ -845,6 +846,7 @@ pub struct BlockCommentConfig {
/// A character to add as a prefix when a new line is added to a block comment.
pub prefix: Arc<str>,
/// A indent to add for prefix and end line upon new line.
#[schemars(range(min = 1, max = 128))]
pub tab_size: u32,
}