[PATCH] D124260: [clang-format] ColumnLimit check for trailing comments alignment acts wrong for multi-byte UTF-8 #47624
Александр Тулуп via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sat Apr 23 14:12:40 PDT 2022
StailGot updated this revision to Diff 424749.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D124260/new/
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;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D124260.424749.patch
Type: text/x-patch
Size: 610 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220423/3e350c22/attachment.bin>
More information about the cfe-commits
mailing list