mirror of
https://github.com/helix-editor/helix
synced 2026-08-06 15:02:59 +02:00
Replaces the tail/all ancestor-sum walk with "indent = number of @indent scopes containing the line". Brace-less bodies use a new `scope "header"` annotation, the dead tail/all scope annotations are removed from the indent queries.
33 lines
439 B
Scheme
33 lines
439 B
Scheme
; queries for helix to do automatic indentation upon hitting enter
|
|
; TODO: needs more work, cover more cases
|
|
[
|
|
(entity)
|
|
(method)
|
|
(behavior)
|
|
(constructor)
|
|
(block)
|
|
(tuple)
|
|
(grouped)
|
|
] @indent
|
|
(match_case body: (block) @indent)
|
|
; ffi_call and call
|
|
(_ arguments: (_) @indent)
|
|
(assignment right: (_) @indent
|
|
|
|
)
|
|
|
|
[
|
|
(params)
|
|
(object)
|
|
("if")
|
|
] @extend
|
|
(lambda params: (_) @extend)
|
|
|
|
[
|
|
"end"
|
|
"}"
|
|
"]"
|
|
")"
|
|
"|"
|
|
] @outdent
|