Closed hololeap closed 4 months ago
The lib is unfortunately a poor fit for tab-indented output, since the WL algorithm keeps track of the current column in lots of places, e.g. the current column variable cc
(Current column, i.e. "where the cursor is"
). I don’t think this is easy to adapt to tab-based indentation without adding a lot of complexity everywhere that has spaces (leading or not).
A workaround would be postprocessing the output and replacing every 8 leading spaces with a tab.
A workaround would be postprocessing the output and replacing every 8 leading spaces with a tab.
Ok, this is what I ended up doing. I was just curious if this could be a realistic feature. Thanks for responding!
I'm looking at using
prettyprinter
to generate.ebuild
files, which use tabs instead of spaces for indentation. Every indentation-related function (such asalign
andhang
) makes use of spaces exclusively with no way to change this behavior. It doesn't look like creating a new rendering function will solve this problem either. The only thing I have thought of would be to add a new field toLayoutOptions
which carries the desired indentation character.Is there a way to use tabs instead of spaces currently? If this is outside the scope of the package, are there any other packages that provide the ease-of-use of
prettyprinter
(esp. thealign
andhang
functions) but support using tabs for indentation?