From 1580445e35d38a2e5a4acd17222f38cdc6b96161 Mon Sep 17 00:00:00 2001 From: chtenb Date: Thu, 10 Apr 2025 09:50:29 +0200 Subject: [PATCH] Up MAX_INDENT to 128 --- helix-core/src/indent.rs | 6 +++--- helix-core/src/syntax/config.rs | 11 ++++++----- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/helix-core/src/indent.rs b/helix-core/src/indent.rs index a1e2c8640..3488a3281 100644 --- a/helix-core/src/indent.rs +++ b/helix-core/src/indent.rs @@ -23,9 +23,9 @@ pub enum IndentStyle { Spaces(u8), } -// 16 spaces -const INDENTS: &str = " "; -pub const MAX_INDENT: u8 = 16; +// 128 spaces +const INDENTS: &str = " "; +pub const MAX_INDENT: u8 = 128; impl IndentStyle { /// Creates an `IndentStyle` from an indentation string. diff --git a/helix-core/src/syntax/config.rs b/helix-core/src/syntax/config.rs index 432611bb0..2b89cba30 100644 --- a/helix-core/src/syntax/config.rs +++ b/helix-core/src/syntax/config.rs @@ -1,4 +1,4 @@ -use crate::{auto_pairs::AutoPairs, diagnostic::Severity, Language}; +use crate::{auto_pairs::AutoPairs, diagnostic::Severity, indent::MAX_INDENT, Language}; use globset::GlobSet; use helix_stdx::rope; @@ -595,12 +595,13 @@ where D: serde::Deserializer<'de>, { usize::deserialize(deserializer).and_then(|n| { - if n > 0 && n <= 16 { + if n > 0 && n <= MAX_INDENT.into() { Ok(n) } else { - Err(serde::de::Error::custom( - "tab width must be a value from 1 to 16 inclusive", - )) + Err(serde::de::Error::custom(format!( + "tab width must be a value from 1 to {} inclusive", + MAX_INDENT + ))) } }) }