This is an archive of the discontinued LLVM Phabricator instance.

[clang-format] comment reflow: add last line's penalty when ending broken
ClosedPublic

Authored by krasimir on Aug 7 2018, 3:12 AM.

Details

Summary

This fixes a bug in clang-format where the last line's penalty is not
taken into account when its ending is broken. Usually the last line's penalty
is handled by addNextStateToQueue, but in cases where the trailing */ is put
on a newline, the contents of the last line have to be considered for penalizing.

Diff Detail

Repository
rL LLVM

Event Timeline

krasimir created this revision.Aug 7 2018, 3:12 AM
mprobst accepted this revision.Aug 7 2018, 3:16 AM
This revision is now accepted and ready to land.Aug 7 2018, 3:16 AM
This revision was automatically updated to reflect the committed changes.
This revision was automatically updated to reflect the committed changes.