StailGot created this revision. StailGot added a project: clang-format. Herald added a project: All. StailGot requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits.
Fix for https://github.com/llvm/llvm-project/issues/47624 Used token for counting length instead of logical symbols. That leads to wrong length count with utf8 symbols Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D124260 Files: clang/lib/Format/WhitespaceManager.cpp Index: clang/lib/Format/WhitespaceManager.cpp =================================================================== --- clang/lib/Format/WhitespaceManager.cpp +++ clang/lib/Format/WhitespaceManager.cpp @@ -909,8 +909,8 @@ if (Style.ColumnLimit == 0) ChangeMaxColumn = UINT_MAX; - else if (Style.ColumnLimit >= Changes[i].TokenLength) - ChangeMaxColumn = Style.ColumnLimit - Changes[i].TokenLength; + else if (Style.ColumnLimit >= Changes[i].Tok->ColumnWidth) + ChangeMaxColumn = Style.ColumnLimit - Changes[i].Tok->ColumnWidth; else ChangeMaxColumn = ChangeMinColumn;
Index: clang/lib/Format/WhitespaceManager.cpp =================================================================== --- clang/lib/Format/WhitespaceManager.cpp +++ clang/lib/Format/WhitespaceManager.cpp @@ -909,8 +909,8 @@ if (Style.ColumnLimit == 0) ChangeMaxColumn = UINT_MAX; - else if (Style.ColumnLimit >= Changes[i].TokenLength) - ChangeMaxColumn = Style.ColumnLimit - Changes[i].TokenLength; + else if (Style.ColumnLimit >= Changes[i].Tok->ColumnWidth) + ChangeMaxColumn = Style.ColumnLimit - Changes[i].Tok->ColumnWidth; else ChangeMaxColumn = ChangeMinColumn;
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits