summaryrefslogtreecommitdiff
path: root/helix-view/src/editor.rs
diff options
context:
space:
mode:
authorDaniel Ebert2023-09-19 13:31:38 +0000
committerBlaž Hrastnik2023-12-15 06:59:54 +0000
commit938a710904ae6d328d4008626d98acb9e907813a (patch)
treedf6a641d82d0c82b61ecc7ffe68011d0dca24453 /helix-view/src/editor.rs
parent559bfc1f5ef1bd43fd94325c0363058e32c76df4 (diff)
Make the indent heuristic configurable
Diffstat (limited to 'helix-view/src/editor.rs')
-rw-r--r--helix-view/src/editor.rs6
1 files changed, 5 insertions, 1 deletions
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<SmartTabConfig>,
+ /// 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(),
}
}
}