Open YodaEmbedding opened 2 months ago
I get this for your sample at https://github.com/nvim-treesitter/nvim-treesitter/commit/04401b5dd17c3419dae5141677bd256f52d54733:
def conditional_return(x):
if x:
return True
MARKER
Could you check that the plugin is activated by :set indentexpr?
?
Ah, you're right. I'd forgotten to set it up to not use treesitter's default (indentexpr=nvim_treesitter#indent()
). I fixed it so it now loads correctly (indentexpr=v:lua.require'nvim-yati.indent'.indentexpr()
).
The current behavior is fine, though it's different from the "expected", where the MARKER has only one indent.
Bug: If a
return
statement is the last child in a pre-order (or in-order) traversal, then the indent level resets to the level of the parent function.Actual:
Expected: