>>> With this patch the following case works correctly in test.heex: >>> >>> <%= if true do %> >>>
hello, tree-sitter!
>>> <% end| %> >>> >>> With point at "|" the command 'backward-sexp' (C-M-b) >>> correctly jumps to the beginning of "if". >> >> Right. I think it can be done in backward-sexp since there we know >> we’re moving back. I assume that’s what you mean. > > The problem is that the last time when the arg is still -1 > is in 'treesit-forward-sexp', and then it calls > 'treesit-beginning-of-thing' with '(abs arg)'. > > The complete call chain: > > - treesit-forward-sexp > - treesit-beginning-of-thing > - treesit-navigate-thing > - treesit-thing-at > - treesit-node-at > - treesit-parsers-at > - overlays-at > > So not clear how to propagate the flag for decrementing the offset. > Maybe by let-binding a new dynamically bound variable? Ok, here is the patch: