From b1791bc488c0dc3a1ae86e70fe54dcb71c25e403 Mon Sep 17 00:00:00 2001 From: Garrett Hopper Date: Wed, 7 May 2025 19:36:59 -0500 Subject: [PATCH] Fix indentation of lines within node preceding opening delimiter --- lua/nvim-treesitter/indent.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/nvim-treesitter/indent.lua b/lua/nvim-treesitter/indent.lua index 1723c30bb..d05723e39 100644 --- a/lua/nvim-treesitter/indent.lua +++ b/lua/nvim-treesitter/indent.lua @@ -306,7 +306,7 @@ function M.get_indent(lnum) end else -- aligned indent - if c_is_last_in_line and c_srow and o_srow ~= c_srow and c_srow < lnum - 1 then + if lnum - 1 <= o_srow or (c_is_last_in_line and c_srow and o_srow ~= c_srow and c_srow < lnum - 1) then -- If current line is outside the range of a node marked with `@aligned_indent` -- Then its indent level shouldn't be affected by `@aligned_indent` node indent = math.max(indent - indent_size, 0)