klimek added inline comments.
================
Comment at: lib/Format/ContinuationIndenter.cpp:1158-1159
+ CommentPragmasRegex.match(Current.TokenText.substr(2)) ||
+ Current.TokenText.substr(2).ltrim().startswith("clang-format on") ||
+ Current.TokenText.substr(2).ltrim().startswith("clang-format off"))
return addMultilineToken(Current, State);
----------------
krasimir wrote:
> klimek wrote:
> > Generally, we shouldn't need those here, as those should be part of the
> > Token.Finalized state.
> Here the problem is that the comments /* clang-format on */ and /*
> clang-format off */ control the formatting of the tokens in between, but do
> not control their own formatting, that is they are not finalized themselves.
> What happens is that if we rely solely on Token.Finalized and the ColumnLimit
> is small, say 20, then:
> ```
> /* clang-format off */
> ```
> gets broken into:
> ```
> /* clang-format off
> */
> ```
>
> Add comments about this.
Isn't the right fix to change the tokens of the comment to be finalized?
https://reviews.llvm.org/D28764
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits