Skip to content

Conversation

@Thiez
Copy link
Contributor

@Thiez Thiez commented Feb 9, 2013

A simple fix for issue 2174.

Thiez added 2 commits February 9, 2013 00:57
The function that formats and prints the squigly line that hilights
errors counted tabs as spaces, which resulted in incorrect error
messages when tabs were used for indentation. This change compares
the highlight line with the previous line and inserts a tab instead
of a space whenever such a tab exists on the previous line. Note
that error messages will still highlight incorrectly when the
previous line include characters that require more than one utf8
code point, as mentioned in issue 3260.
@sanxiyn
Copy link
Contributor

sanxiyn commented Feb 9, 2013

Am I correct in that this handles tabs before the highlighted range, but does not handle tabs in the highlighted range? (Won't matter much in practice since tabs are usually for indentation, but just for completeness.)

@Thiez
Copy link
Contributor Author

Thiez commented Feb 9, 2013

Now that you mention it, this fix does not handle that case properly. However I can't think of a way to fix that without knowing the length of a tab in advance. I'm reluctant to make an assumption here, as a highlighted range that is too long may be much more confusing that one that is too short.

bors added a commit that referenced this pull request Feb 9, 2013
@bors bors closed this Feb 9, 2013
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

Successfully merging this pull request may close these issues.

4 participants