aboutsummaryrefslogtreecommitdiffstats
path: root/lua
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
parentfeat(indents): add support for language injection (diff)
downloadnvim-treesitter-62982378b81ce91d5cdf70047113e51e13434286.tar
nvim-treesitter-62982378b81ce91d5cdf70047113e51e13434286.tar.gz
nvim-treesitter-62982378b81ce91d5cdf70047113e51e13434286.tar.bz2
nvim-treesitter-62982378b81ce91d5cdf70047113e51e13434286.tar.lz
nvim-treesitter-62982378b81ce91d5cdf70047113e51e13434286.tar.xz
nvim-treesitter-62982378b81ce91d5cdf70047113e51e13434286.tar.zst
nvim-treesitter-62982378b81ce91d5cdf70047113e51e13434286.zip
indents(cpp): indent at field_initializer_list
Diffstat (limited to 'lua')
-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 d63f43207..a86b5baf5 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