You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When user selects a snippet in Eclipse editor and uses Ctrl+Shift+F to run clang-format for it, the location of the snippet is specified to clang-format using -offset and -length command line arguments.
Problem is that while clang-format expects them as bytes, CppStyle uses character counts. Considering Unicode characters, this goes easily wrong and the snippet selection becomes unreliable.
One way to tackle this is to use -lines instead of -offset/-length since clang-format also translates the -offset/-length into line numbers internally (no additional accuracy boost from using the byte definitions).
The text was updated successfully, but these errors were encountered:
When user selects a snippet in Eclipse editor and uses Ctrl+Shift+F to run clang-format for it, the location of the snippet is specified to clang-format using -offset and -length command line arguments.
Problem is that while clang-format expects them as bytes, CppStyle uses character counts. Considering Unicode characters, this goes easily wrong and the snippet selection becomes unreliable.
One way to tackle this is to use -lines instead of -offset/-length since clang-format also translates the -offset/-length into line numbers internally (no additional accuracy boost from using the byte definitions).
The text was updated successfully, but these errors were encountered: