fables-tales / rubyfmt

Ruby Autoformatter!
MIT License
1.07k stars 50 forks source link

Fix winding lines forward multiple lines #429

Closed reese closed 12 months ago

reese commented 1 year ago

Closes #413

When we wind lines forward with wind_dumping_comments_until_line, we have a check to make sure we're still in the file. This check gets set by incrementing a counter on on_nl inside the parser, but (1) this was incorrect because on_nl wasn't getting called and (2) this is unnecessary since we have the file contents saved, so we can just use the line count instead.