Clojure indent #_ properly, search parents for indent.end

This commit is contained in:
Garrett Hopper 2025-05-07 15:56:49 -05:00
parent fba13d610e
commit 5f284e4b74
2 changed files with 7 additions and 1 deletions

View file

@ -177,7 +177,10 @@ function M.get_indent(lnum)
node = get_last_node_at_line(root, prevlnum, col) node = get_last_node_at_line(root, prevlnum, col)
end end
end end
if q["indent.end"][node:id()] then -- Recursively search upwards for any @indent.end nodes
local tmp = node
while tmp and not q["indent.end"][tmp:id()] do tmp = tmp:parent() end
if tmp then
node = get_first_node_at_line(root, lnum) node = get_first_node_at_line(root, lnum)
end end
else else

View file

@ -21,3 +21,6 @@
(anon_fn_lit . (sym_lit))] (anon_fn_lit . (sym_lit))]
@indent.align @indent.align
(#set! indent.increment 2)) (#set! indent.increment 2))
; Indent form on line following #_
((dis_expr) @indent.begin @indent.end)