Skip to content

Comment on Ask HN: I can't read code indented with 2 spaces: do I need glasses?

Comments

Just an idea I haven't seen implemented yet:

Tabs have the advantage of beeing of variable width while spaces don't. But two or more consecutive spaces are rarely used for more than just aligning code. In theory the editor could render double the spaces (or rather a space with twice the width) for every amount of spaces higher than one, effectively doubling the indent.

No conversion (retabbing) would have to take place and therefore no hardcoding the value, which often breaks languages which don't like mixed tabs and spaces as the retabber might encounter three consecutive spaces and only convert two of them to a tab if told to do so.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.