Account for tabs when printing diagnostic caret
Currently tabs are treated as having a width of 1, which means the diagnostic caret is misaligned if the line contains any tabs before the location being indicated.
I don't think there's a reliable way to get the tab width; it seems that gcc and clang just print tabs as a fixed number of spaces (gcc by default seems to use 2, clang uses 8).
I don't think there's a reliable way to get the tab width; it seems that gcc and clang just print tabs as a fixed number of spaces (gcc by default seems to use 2, clang uses 8).
The standard does not specify one, but one could use the .editorconfig, see https://editorconfig.org/ "indent_style = space, indent_size = 4". The editorconfig has no way to define a correct encoding in all cases (ie utf16-le-bom etc not possible).