Make 4-space indents look like 2-space ones


I have a small plugin that doubles the visual length of space indents (using empty inlays). I was wondering if there is a workaround to do the other way around e.g. if your file is indented with 4 spaces make it look like it's indented with 2.
So far I considered folding, but It seems like that this approach is language-specific, e.g. I need a separate folder for Java and another one for Markdown...
I also looked at somehow using inlays again, but I don't see a way how to "override" the content of the editor (including the length of the region)
Are there any approaches that would make it possible? Or is the functionality that makes the tab characters elastic is available to plugin developers so I can do the same with spaces ?

Please sign in to leave a comment.