From 938a710904ae6d328d4008626d98acb9e907813a Mon Sep 17 00:00:00 2001 From: Daniel Ebert Date: Tue, 19 Sep 2023 15:31:38 +0200 Subject: Make the indent heuristic configurable --- helix-view/src/editor.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'helix-view') diff --git a/helix-view/src/editor.rs b/helix-view/src/editor.rs index 5a81cb5d..f2e85307 100644 --- a/helix-view/src/editor.rs +++ b/helix-view/src/editor.rs @@ -42,7 +42,7 @@ use anyhow::{anyhow, bail, Error}; pub use helix_core::diagnostic::Severity; use helix_core::{ auto_pairs::AutoPairs, - syntax::{self, AutoPairConfig, SoftWrap}, + syntax::{self, AutoPairConfig, IndentationHeuristic, SoftWrap}, Change, LineEnding, NATIVE_LINE_ENDING, }; use helix_core::{Position, Selection}; @@ -291,6 +291,9 @@ pub struct Config { pub insert_final_newline: bool, /// Enables smart tab pub smart_tab: Option, + /// Which indent heuristic to use when a new line is inserted + #[serde(default)] + pub indent_heuristic: IndentationHeuristic, } #[derive(Debug, Clone, PartialEq, Deserialize, Serialize, Eq, PartialOrd, Ord)] @@ -841,6 +844,7 @@ impl Default for Config { default_line_ending: LineEndingConfig::default(), insert_final_newline: true, smart_tab: Some(SmartTabConfig::default()), + indent_heuristic: IndentationHeuristic::default(), } } } -- cgit v1.2.3-70-g09d2