summaryrefslogtreecommitdiff
path: root/lua/nvim-treesitter
diff options
context:
space:
mode:
authorStephan Seitz <stephan.seitz@fau.de>2022-01-22 14:07:01 +0100
committerStephan Seitz <stephan.seitz@fau.de>2022-02-05 18:54:55 +0100
commit62982378b81ce91d5cdf70047113e51e13434286 (patch)
tree28dacb8eede933202f85860846138cb7afa40b52 /lua/nvim-treesitter
parent7654bbc04bf6b51e583d5241dab62f48ee564b93 (diff)
indents(cpp): indent at field_initializer_list
Diffstat (limited to 'lua/nvim-treesitter')
-rw-r--r--lua/nvim-treesitter/indent.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/lua/nvim-treesitter/indent.lua b/lua/nvim-treesitter/indent.lua
index d63f4320..a86b5baf 100644
--- a/lua/nvim-treesitter/indent.lua
+++ b/lua/nvim-treesitter/indent.lua
@@ -117,7 +117,7 @@ function M.get_indent(lnum)
end
-- do not indent for nodes that starts-and-ends on same line and starts on target line (lnum)
- if not is_processed_by_row[srow] and (q.indent[node:id()] and srow ~= erow and srow ~= lnum - 1) then
+ if not is_processed_by_row[srow] and (q.indent[node:id()] and srow ~= erow and ((srow ~= lnum - 1) or q.indent[node:id()].start_at_same_line)) then
indent = indent + indent_size
is_processed = true
end