You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current margin stripping logic seems mildly inconsistent to me:
we ignore lines that consistent only of whitespace
but then we persist the trailing whitespace in them that comes after the margin
I am inclined to think we should just strip trailing whitespace from every line, and then ignore empty lines for purposes of margin computation. The margin stripping logic is already kind of 'dwim', this seems typically desirable.
The other internally consistent option in my mind would be to never strip trailing whitespace but also count all non-empty lines for margin computation (even if they are only whitespace).
I'm open to either of them, to be honest. The reason I mildly lean towards stripping trailing whitespace is that some editors, when you press enter, will add in the whitespace needed for the indent (at least I think they do), and I can imagine people not realizing that and being confused why something like
foo
bar
prints as " foo\n\n bar\n" (hint: it's because the middle line has two spaces, so the margin is only 2, not 4).
The text was updated successfully, but these errors were encountered:
The current margin stripping logic seems mildly inconsistent to me:
I am inclined to think we should just strip trailing whitespace from every line, and then ignore empty lines for purposes of margin computation. The margin stripping logic is already kind of 'dwim', this seems typically desirable.
The other internally consistent option in my mind would be to never strip trailing whitespace but also count all non-empty lines for margin computation (even if they are only whitespace).
I'm open to either of them, to be honest. The reason I mildly lean towards stripping trailing whitespace is that some editors, when you press enter, will add in the whitespace needed for the indent (at least I think they do), and I can imagine people not realizing that and being confused why something like
prints as
" foo\n\n bar\n"
(hint: it's because the middle line has two spaces, so the margin is only 2, not 4).The text was updated successfully, but these errors were encountered: