Closed antifuchs closed 4 months ago
(I pushed two updates to this that should handle indenting ${}
on a line and make first-line indent behavior more robust, too: I think this is basically "working" now, but I'd love to see if we can make a test for it)
Update: OK, now we've got tests - hope they actually run in a blank slate, as I can only run them interactively now (see #16)
This looks good, so I'll take the liberty of merging.
Since treesit's "simple" indentation functions don't play too well with multi-line strings, create a new function,
nix-ts-indent-multiline-string
, which determines the point to which a line should be indented based on some simple heuristics: The first line in the multiline string gets indented to (offset+prev line); the following lines get their (manual) indentation left alone, and default to the offset of the previous line.This fixes #14.