mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-02 03:26:52 -04:00
indents: allow aligned_indent for unfinished calls in C and Python
This commit is contained in:
parent
62982378b8
commit
059fbc487c
7 changed files with 26 additions and 3 deletions
|
|
@ -122,7 +122,8 @@ function M.get_indent(lnum)
|
|||
is_processed = true
|
||||
end
|
||||
|
||||
if q.aligned_indent[node:id()] and srow ~= erow then
|
||||
-- do not indent for nodes that starts-and-ends on same line and starts on target line (lnum)
|
||||
if q.aligned_indent[node:id()] and srow ~= erow and (srow ~= lnum - 1) then
|
||||
local metadata = q.aligned_indent[node:id()]
|
||||
local opening_delimiter = metadata.delimiter:sub(1, 1)
|
||||
local o_delim_node, pos = get_matching_prev_sibling(node, { srow, #vim.fn.getline(srow + 1) - 1 }, function(n)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue