Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unicode not handled properly when specifying -offset and -length #35

Open
lassiniemisto opened this issue Sep 3, 2018 · 1 comment
Open

Comments

@lassiniemisto
Copy link

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).

@lassiniemisto
Copy link
Author

This occurs on the 1.5.x version on Eclipse Mars (And yes I am particularly interested in getting this fixed for Mars..)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant