Bug 382465 - Code highlighting shifted after UTF-8 character
Summary: Code highlighting shifted after UTF-8 character
Status: RESOLVED DUPLICATE of bug 274430
Alias: None
Product: kdevelop
Classification: Applications
Component: Language Support: CPP (Clang-based) (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-07-18 13:48 UTC by tuxtoriel
Modified: 2022-01-13 14:58 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Examples screenshot (5.26 KB, image/png)
2017-07-18 13:48 UTC, tuxtoriel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description tuxtoriel 2017-07-18 13:48:29 UTC
Created attachment 106707 [details]
Examples screenshot

When, in the code, a character like '…', '«', '»', 'ç', 'ß' is used, the code highlighting after it is shifted.

Example:

OK:
    `std::cout << "Does this work?" << std::endl;`
BUG:
    `std::cout << "Does this work?…" << std::endl;` here the shift is of 2 characters
BUG:
    `std::cout << "Does this work?ç" << std::endl;` here the shift is of 1 character
Comment 1 Dan Weatherill 2018-01-16 19:56:44 UTC
I'm pretty sure this is the same issue that this person runs into: 
https://stackoverflow.com/questions/47192819/libclang-get-correct-reference-of-identifier-with-extended-characters-for-vari
Comment 2 Vitaliy 2018-03-07 19:48:48 UTC
(In reply to Dan Weatherill from comment #1)
> I'm pretty sure this is the same issue that this person runs into: 
> https://stackoverflow.com/questions/47192819/libclang-get-correct-reference-
> of-identifier-with-extended-characters-for-vari

That only means libclang reports byte indices instead of character indices. But KDevelop has the lines so has all the information necessary to convert them back and forth.
Comment 3 Igor Kushnir 2022-01-13 14:58:03 UTC

*** This bug has been marked as a duplicate of bug 274430 ***