aboutsummaryrefslogtreecommitdiff
path: root/queries/jai/indents.scm
diff options
context:
space:
mode:
authorDemonKingSwarn <rockingswarn@gmail.com>2026-05-03 01:17:12 +0530
committerDemonKingSwarn <rockingswarn@gmail.com>2026-05-03 01:17:12 +0530
commit1c7a8e4afaca2d0687e4c0c735f7280d62b560ec (patch)
tree53af199c685697feaa5d0286d826dcee59058a7a /queries/jai/indents.scm
parentf1973e83d82818583b91786198e81895bc927044 (diff)
downloadnvim-1c7a8e4afaca2d0687e4c0c735f7280d62b560ec.zip
nvim-1c7a8e4afaca2d0687e4c0c735f7280d62b560ec.tar.gz
Fixed Bug
an automated commit
Diffstat (limited to 'queries/jai/indents.scm')
-rw-r--r--queries/jai/indents.scm67
1 files changed, 67 insertions, 0 deletions
diff --git a/queries/jai/indents.scm b/queries/jai/indents.scm
new file mode 100644
index 0000000..82b0331
--- /dev/null
+++ b/queries/jai/indents.scm
@@ -0,0 +1,67 @@
+; Some documentation I found in a random github issue
+; @indent.begin ; indent children when matching this node
+; @indent.end ; marks the end of indented block
+; @indent.align ; behaves like python aligned/hanging indent
+; @indent.dedent ; dedent children when matching this node
+; @indent.branch ; dedent itself when matching this node
+; @indent.ignore ; do not indent in this node
+; @indent.auto ; behaves like 'autoindent' buffer option
+; @indent.zero ; sets this node at position 0 (no indent)
+
+; NOTE: these don't work well with Allman style.
+; Also; I am really bad at this. There is almost no documentation available and I don't speak lisp or whichever of it's flavors this is.
+
+; Incomplete
+
+[
+ (block)
+ (enum_declaration "{")
+ (struct_or_union_block "{")
+ (struct_literal "{")
+ (anonymous_enum_type "{")
+ (asm_statement "{")
+ (array_literal "[")
+ (index_expression "[")
+ (literal)
+ (assignment_parameters "(")
+] @indent.begin
+
+((modify_block) @indent.end)
+((place_directive) @indent.branch)
+
+; only indent the first statement after an if
+(if_statement_condition_and_consequence
+ consequence: (_
+ ";" @indent.end) @_consequence
+ (#not-match? @_consequence "\\{")
+) @indent.begin
+
+(else_clause) @indent.branch
+
+; This is a workaround. I can't get 'else if' indentation to work properly.
+(else_clause
+ consequence: (_) @_consequence
+ (#match? @_consequence "if")
+) @indent.auto
+
+(if_case_statement) @indent.begin
+(switch_case ";") @indent.branch
+
+((identifier) . (ERROR "(" @indent.begin))
+
+(block
+ "}" @indent.end)
+
+[
+ ")"
+ "]"
+ "}"
+] @indent.branch @indent.end
+
+[
+ (comment)
+ (block_comment)
+ (string)
+ (ERROR)
+] @indent.auto
+