Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

But an editor can just as well let the user choose what width to display spaces at the start of a line. Nothing forces them to be the same width as spaces in the middle of a line.


Nope, an editor can do that, but it can’t do it just as well because not all spaces at the beginning are indentation, so then you need to have more complicated rules to differentiate between those cases


Too bad editors can't do something as complex as recognize language syntax. Imagine if we had that feature, then we could do things like syntax coloring.

Sarcasm aside, if your editor can't recognize indentation or adjust indentation according to arbitrary preferences, you really need to update your toolset.


Too bad indeed that your fantasy toolset doesn't exist in reality


which editor does that? space width is defined by the font, and normally you use monospace fonts. i am unfamiliar with any editor that allows you to choose a different font for spaces. besides, it would only work for indents, it would mess up any alignment of code into columns.


None, but it's clearly possible to add since such handling is already present for tabs in almost any editor. I merely mean that there's no technical restriction.


But this option already exists for tabs that are pretty much built for this purpose. It's like adding a fifth wheel to a car because there's no technical restriction even though 4 work fine


But don't fixed width fonts, which many consider the best for code, mean fixed width spaces too?


If that were the case tabs would be fixed width too. But they're not. There's no fundamental reason tabs have to be the only variable-width character.


Tabs would only be variable in the number of spaces uses, but those spaces will be fixed width.


And spaces could be variable in the number of "sub-spaces" used. Each could be say 1/8 of a regular space.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: