Clamp tab_size
setting between 1 and 16 (#17882)
Release Notes: - Changed `tab_size` setting to require values be between 1 and 16 (inclusive). ### jetbrains settings #### Max value  When the maximum value is exceeded, the configuration box turns red to remind the user  If the user still saves, jetbrains does not process it and resets it to the system default value of 4 <img width="700" alt="image" src="https://github.com/user-attachments/assets/a76b1cba-d23f-4a32-95ee-f05d208ca186"> Without restrictions, I feel not good. Here is a random setting of a relatively large value https://github.com/user-attachments/assets/c3bdf262-ba08-4bc2-996a-5ad2a37c567f --------- Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
This commit is contained in:
parent
e3d54b2211
commit
2baa704af7
1 changed files with 4 additions and 0 deletions
|
@ -1027,6 +1027,10 @@ fn merge_settings(settings: &mut LanguageSettings, src: &LanguageSettingsContent
|
|||
}
|
||||
|
||||
merge(&mut settings.tab_size, src.tab_size);
|
||||
settings.tab_size = settings
|
||||
.tab_size
|
||||
.clamp(NonZeroU32::new(1).unwrap(), NonZeroU32::new(16).unwrap());
|
||||
|
||||
merge(&mut settings.hard_tabs, src.hard_tabs);
|
||||
merge(&mut settings.soft_wrap, src.soft_wrap);
|
||||
merge(&mut settings.use_autoclose, src.use_autoclose);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue