3 ms·
Why do you think it can't shrink below 1? That's exactly what's happening in currently rudimentary implementations like in Sublime Text, where width can be sma
by eviks 3y ago
Why do you think it can't shrink below 1?
That's exactly what's happening in currently rudimentary implementations like in Sublime Text, where width can be smaller if needed for alignment
The "spec" also doesn't seem to mandate a minimum
- kragen 3y agothe illustrations on gravgaard's page show a minimum of one space between columns, even in places where that seriously compromises the desired formatting, such as int someDemoCode( int fred, int wilma) i think it would be better to represent that, where actually desired, by 00000000: 696e 7420 736f 6d65 4465 6d6f 436f 6465 int someDemoCode 00000010: 2820 0969 6e74 2066 7265 642c 0a09 696e ( .int fred,..in 00000020: 7420 7769 6c6d 6129 0a t wilma). . (note the explicit space following the left paren) and render 00000030: 696e 7420 736f 6d65 4465 6d6f 436f 6465 int someDemoCode 00000040: 2809 696e 7420 6672 6564 2c0a 0969 6e74 (.int fred,..int 00000050: 2077 696c 6d61 290a wilma). as the more acceptable int someDemoCode(int fred, int wilma) which i think differs from gravgaard's intended semantics
- eviks 3y agoI see. Yeah, in this case I'd also prefer no space betwen ( and int But then in your design how would you Tab to actually add whitespace, not just vertically align? Would then 2nd tab have a width of 1 space?
- kragen 3y agoyou wouldn't use the tab ('horizontal tabulation') character to add space, but rather to separate table columns; you would use the space character to add space https://en.wikipedia.org/wiki/Tab_key https://en.wikipedia.org/wiki/Tab_key > The word tab derives from the word tabulate, which means "to arrange data in a tabular, or table, form."
- eviks 3y agoBut table columns are separated visually by whitespace otherwise you can't separate them in many cases when the text is glued together! (in richer formatting schemes this is achieved by border padding) So, say, for TSV files (where you can't add spaces as that would affect the field values) you'd just have an editor with this feature let the max-width columns be glued, correct? And speaking of wiki, the key part of tab is this (the etymology is just a historical artifact that should have no effect on what the best design is): > Pressing the tab key would advance the carriage to the next tabulator stop. The tabulation stops is another great missing feature from the MS Words of the world
- kragen 3y agoif you don't have an escape sequence to set border padding for the current column or table, a simple expedient is to insert a space at the end of the widest cell of each column, or every cell if you don't know which cell is widest (say, because you're programmatically producing output to be rendered in an unknown font). it's true that there are occasional tsv files where that would corrupt your data (because they contain unquoted strings that aren't trimmed of trailing spaces on input), but those files are already in trouble with conventional terminals if a trailing space matters, because that data corruption would be invisible if you have a header line, and your field names do get trimmed on input (or discarded), you can insert the padding spaces there for tabular data display, escape sequences to insert vertical rules between columns are also desirable the tab-stop mechanism is just a 19th-century limitation in the mechanical typewriter technology of the time. we can design new systems today that do what we think is most useful; from my point of view, arranging information in a table is more useful than advancing to the next tabstop here's some output i got from vmstat 5 today procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu----- r b swpd free buff cache si so bi bo in cs us sy id wa st 0 0 1557232 132264 121644 1632328 1 4 34 48 17 57 12 5 83 0 0 0 0 1557232 132004 121652 1632368 0 0 0 9 561 971 1 1 98 0 0 1 0 1560816 233716 119836 1534920 0 717 0 4020 1286 2227 13 5 82 0 0 0 0 1560816 234220 119844 1534920 0 0 0 10 863 1919 3 2 95 0 0 ugh as it happens, arranging text in tables also gives you the ability to do a flexible visual layout that accommodates proportional fonts of multiple sizes, so you can also stop using ugly typewriter fonts we can stop imitating the typewriter's flaws now, we've had pixels for 60 years already. the question is how to make pixels as easy to use as a typewriter