Fix whitespace before comments

Looks like whitespace after comments is handled correctly, but not before them.
This is kinda weird. I was hoping to just always subtract the number of existing newlines from `i` but it affected caused some other tests to fail.