aboutsummaryrefslogtreecommitdiff
path: root/book/src/guides
diff options
context:
space:
mode:
authorDaniel Ebert2023-09-19 14:14:23 +0000
committerBlaž Hrastnik2023-12-15 06:59:54 +0000
commita5acfdbf104db82310b71da988ef8a5df43ffd49 (patch)
treeff8ba19178dae461c6c513ea6a365f6c3218112f /book/src/guides
parent938a710904ae6d328d4008626d98acb9e907813a (diff)
Add documentation for new indent computation
Diffstat (limited to 'book/src/guides')
-rw-r--r--book/src/guides/indent.md9
1 files changed, 9 insertions, 0 deletions
diff --git a/book/src/guides/indent.md b/book/src/guides/indent.md
index bd037bb0..a65ac5ac 100644
--- a/book/src/guides/indent.md
+++ b/book/src/guides/indent.md
@@ -12,6 +12,15 @@ Note that it matters where these added indents begin. For example,
multiple indent level increases that start on the same line only increase
the total indent level by 1. See [Capture types](#capture-types).
+By default, Helix uses the `hybrid` indentation heuristic. This means that
+indent queries are not used to compute the expected absolute indentation of a
+line but rather the expected difference in indentation between the new and an
+already existing line. This difference is then added to the actual indentation
+of the already existing line. Since this makes errors in the indent queries
+harder to find, it is recommended to disable it when testing via
+`:set indent-heuristic tree-sitter`. The rest of this guide assumes that
+the `tree-sitter` heuristic is used.
+
## Indent queries
When Helix is inserting a new line through `o`, `O`, or `<ret>`, to determine