diff options
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/nvim-treesitter/indent.lua | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lua/nvim-treesitter/indent.lua b/lua/nvim-treesitter/indent.lua index 04aa141bb..4ec0a3e23 100644 --- a/lua/nvim-treesitter/indent.lua +++ b/lua/nvim-treesitter/indent.lua @@ -35,6 +35,7 @@ local get_indents = tsutils.memoize_by_buf_tick(function(bufnr, root, lang) branch = {}, ignore = {}, aligned_indent = {}, + zero_indent = {}, } for name, node, metadata in queries.iter_captures(bufnr, "indents", root, lang) do @@ -88,6 +89,10 @@ function M.get_indent(lnum) -- tracks to ensure multiple indent levels are not applied for same line local is_processed_by_row = {} + if q.zero_indent[node:id()] then + return 0 + end + while node do -- do 'autoindent' if not marked as @indent if not q.indent[node:id()] and q.auto[node:id()] and node:start() < lnum - 1 and lnum - 1 <= node:end_() then |
