On Tue Mar 10, 2026 at 22:02:14 GMT +01, Neil Hodgson wrote:
> Yes. One of the roles of these APIs is to operate with other pieces of
> software that use column numbers. Some tools, for example, report
> warning locations in terms of line and column. These APIs allow
> automatically selecting the warning location or displaying a column
> number UI element that will match the diagnostics.
>
I would suspect that most tools will count only characters if not bytes
since a) they don't know the tab size and b) they don't always know the document's
encoding.
But apparently, there is a lot of variation out there.
GCC expands tabs and counts Unicode glyphs:
hello.c: In function 'main':
hello.c:5:10: error: expected expression before ';' token
5 | +;
| ^
hello.c: In function 'main':
hello.c:5:15: error: expected expression before ';' token
5 | /*Ö*/+;
| ^
This would be compatible with SCI_FINDCOLUMN.
Clang apparently counts plain bytes:
hello.c:5:3: error: expected expression
5 | +;
| ^
hello.c:5:9: error: expected expression
5 | /*Ö*/+;
| ^
Anyway, I will just write my own versions of SCI_GETCOLUMN/SCI_FINDCOLUMN
then.
Regards,
Robin