summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--book/src/configuration.md10
-rw-r--r--helix-term/src/ui/editor.rs3
-rw-r--r--helix-view/src/editor.rs4
3 files changed, 11 insertions, 6 deletions
diff --git a/book/src/configuration.md b/book/src/configuration.md
index 039d181c..276bd7d4 100644
--- a/book/src/configuration.md
+++ b/book/src/configuration.md
@@ -233,10 +233,11 @@ tabpad = "·" # Tabs will look like "→···" (depending on tab width)
Options for rendering vertical indent guides.
-| Key | Description | Default |
-| --- | --- | --- |
-| `render` | Whether to render indent guides. | `false` |
-| `character` | Literal character to use for rendering the indent guide | `│` |
+| Key | Description | Default |
+| --- | --- | --- |
+| `render` | Whether to render indent guides. | `false` |
+| `character` | Literal character to use for rendering the indent guide | `│` |
+| `skip-levels` | Number of indent levels to skip | `0` |
Example:
@@ -244,4 +245,5 @@ Example:
[editor.indent-guides]
render = true
character = "╎"
+skip-levels = 1
```
diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs
index 0269d804..e5dc3c95 100644
--- a/helix-term/src/ui/editor.rs
+++ b/helix-term/src/ui/editor.rs
@@ -436,7 +436,8 @@ impl EditorView {
return;
}
- let starting_indent = (offset.col / tab_width) as u16;
+ let starting_indent =
+ (offset.col / tab_width) as u16 + config.indent_guides.skip_levels;
// TODO: limit to a max indent level too. It doesn't cause visual artifacts but it would avoid some
// extra loops if the code is deeply nested.
diff --git a/helix-view/src/editor.rs b/helix-view/src/editor.rs
index e144a830..f21244a9 100644
--- a/helix-view/src/editor.rs
+++ b/helix-view/src/editor.rs
@@ -552,15 +552,17 @@ impl Default for WhitespaceCharacters {
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
-#[serde(default)]
+#[serde(default, rename_all = "kebab-case")]
pub struct IndentGuidesConfig {
pub render: bool,
pub character: char,
+ pub skip_levels: u16,
}
impl Default for IndentGuidesConfig {
fn default() -> Self {
Self {
+ skip_levels: 0,
render: false,
character: '│',
}