mechatroner / vscode_rainbow_csv

🌈Rainbow CSV - VS Code extension: Highlight CSV and TSV files in different rainbow colors to make them more readable
MIT License
426 stars 51 forks source link

Aligning should add spaces after comma, not before #80

Open bovender opened 3 years ago

bovender commented 3 years ago

This is a great extension, but in my humble opinion, the 'align' command adds spaces in the wrong places:

column 1 ,column 2 , column 3
1        ,2        , 3
4        ,5        , 6

I think for better readability there should be a space after rather than before a comma. Or shouldn't it?

mechatroner commented 3 years ago

Hi @bovender, I appreciate the feedback! I agree, that in the case of commas, whitespaces after the separators would look more natural.

column 1, column 2, column 3
1,        2,        3
4,        5,        6

But in that case, the separators wouldn't be aligned vertically and having them aligned vertically actually gives a readability benefit. Especially so for pipe | separators where the aligned | characters form a resemblance to graphical table lines.

bovender commented 3 years ago

You're totally right, but what about

column 1, column 2, column 3
1       , 2       , 3
4       , 5       , 6

Anyway, it's not a big deal, I just thought if there was a simple tweak to adjust it, it might be useful.

mechatroner commented 3 years ago

Oh, I see what you mean. So basically we want to keep the spaces before but we also want to add exactly one whitespace after for cosmetic reasons. I like your idea, but I am still not sure about potential drawbacks, I can already see a few minor ones (although they probably don't overweight the benefit of the extra space for visual tidiness):

Anyway, I think we should try this; when I have more time on my hands, I will try to adjust the alignment rules.

bovender commented 3 years ago

Thanks, I appreciate it. Yes it's totally cosmetic, so no big deal if it does not work out.

Best wishes

Daniel (@bovender)