From bca103a393f1bf45e2fd5d7c554f0ff77a6b4ff6 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Sun, 12 Jun 2022 20:38:48 +0200 Subject: [PATCH] Fix indent queries You need to add '@indent' to the *parent* node, which whill indent the children. For some reason I understood it as marking the node that should be indented when I wrote these. These were tested manually in Neovim, I need to add a way to test them correctly though. --- queries/indents.scm | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/queries/indents.scm b/queries/indents.scm index 768b842..1c4b2a1 100644 --- a/queries/indents.scm +++ b/queries/indents.scm @@ -1,20 +1,18 @@ ; Control flow {{{ -(if_expression - consequence: (_) @indent) +(if_expression) @indent +"then" @branch "else" @branch -(while_expression - body: (_) @indent) +(while_expression) @indent +"do" @branch -(for_expression - body: (_) @indent) +(for_expression) @indent +"to" @branch ; }}} ; Class {{{ -(class_declaration - fields: (_)* @indent) -(class_type - fields: (_)* @indent) +(class_declaration) @indent +(class_type) @indent ; }}} ; Misc{{{