diff options
author | Ted Kremenek <kremenek@apple.com> | 2008-04-18 05:01:33 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2008-04-18 05:01:33 +0000 |
commit | 12fc014c0407ed0cdc9e975b810db008d9f4992e (patch) | |
tree | f82254eead4722b1df214f4a773d27baf3d0af77 | |
parent | 2cf943a6ac475a08c25a7ca0ca93be5845093cba (diff) |
Fixed range highlighting bug in HTML diagnostics.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49893 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | Driver/HTMLDiagnostics.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/Driver/HTMLDiagnostics.cpp b/Driver/HTMLDiagnostics.cpp index 4d95c17b67..dbc156780f 100644 --- a/Driver/HTMLDiagnostics.cpp +++ b/Driver/HTMLDiagnostics.cpp @@ -326,15 +326,13 @@ void HTMLDiagnostics::HighlightRange(Rewriter& R, SourceRange Range) { if (EndColNo) { // Add in the length of the token, so that we cover multi-char tokens. - EndColNo += Lexer::MeasureTokenLength(Range.getEnd(), SM); + EndColNo += Lexer::MeasureTokenLength(Range.getEnd(), SM) - 1; } // Highlight the range. Make the span tag the outermost tag for the // selected range. - SourceLocation E = LogicalEnd.getFileLocWithOffset(OldEndColNo > EndColNo - ? -(OldEndColNo - EndColNo) - : EndColNo - OldEndColNo); + SourceLocation E = LogicalEnd.getFileLocWithOffset(EndColNo - OldEndColNo); html::HighlightRange(R, LogicalStart, E, "<span class=\"mrange\">", "</span>"); |