indents(cpp): indent at field_initializer_list

This commit is contained in:
Stephan Seitz 2022-01-22 14:07:01 +01:00
parent 7654bbc04b
commit 62982378b8
3 changed files with 20 additions and 1 deletions

View file

@ -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