4 ms·
Don't know how well it displays, but I mean something like this: Dictionary new at: #symbol put: #something; at: #symbol2 put: #somethi
by klibertp 12y ago
Don't know how well it displays, but I mean something like this:
Dictionary new
at: #symbol put: #something;
at: #symbol2 put: #somethingElse;
yourself.
Notice how the first "put" is not aligned with the second one here. It looks aligned in Pharo though, when displayed with default font. This alignment may fall fall apart if I so much as change a font. This is bad, and that's why until the editor is able to preserve my alignment across different fonts I'm going to use monospaced ones.
- joshka 12y agoSounds like that formatting scheme would lead to changes on lines unrelated to the change, e.g. if I renamed symbol2 to sym2, the spacing on #symbol will be reduced. To me this sacrifices diff readability for code readability. It's generally not a tradeoff I like to make, but I can see how it is appealing.
- klibertp 12y agoThis is not an issue for me, because - which is strange - the diff viewers I use seem to be more advanced than my editors, in that the diff viewers can ignore unimportant whitespace changes while editors can't handle alignment properly :-) But that is a trade-off, of course.
- seanmcdirmid 12y agoWhy would you want your editor to preserve your alignment across different fonts? Or to be more precise, why does an editor need to bother with multiple fonts. It's not Word or Latex, the code only needs to look good and read well in one font, and that font is most definitely not a mono space one.
- klibertp 12y agoYou mean that all the programmers should use one and the same font across all their editors? I'm sorry, I don't understand. Is my code meant to be read only by me? What do you mean by that?
- seanmcdirmid 12y agoJust as I said, the code has to look good in one font, not N. When I read a paper written by someone else, the first thing I don't do is casually change its font. We invent so many unreasonable reqs to justify the continued used of archaic type writes fonts, sad.
- klibertp 12y agoI'm sorry, I'm really trying to understand your point but I really see nothing unreasonable in wanting to view someone's code displayed with my preferred font without changing the structure of said code.
- DanBC 12y agoI'm a bit confused by some of the replies - you're talking about proportional fonts for a text editor to view fonts. Using a monospace font makes this easy; using a proportional font makes this very hard. How would an editor know what to align? It's not part of syntax highlighting - unless you define your own rules. The fact that this is not available in Vim nor emacs (I haven't checked; maybe it is) would show that it really is a rare want.
- klibertp 12y agoIn short, what I want is to be able to: a) use proportional font in my editor b) be able to align things horizontally c) ensure that this alignment is preserved when someone opens my code with another editor or another font Presently it's impossible to get all three, so I'm going with b) and c). seanmcdirmid seems to want only a) and b), but without c). As for solution, sean himself pasted something interesting: > Elastic tab stops: http://nickgravgaard.com/elastictabstops/ http://nickgravgaard.com/elastictabstops/ I wasn't aware of that, but it seems interesting, but I didn't look into that much yet. Also, while it seems to cover half of c) (with different font) it will be probably editor dependent (EDIT: but then again, every other solution would be too).