Index: cfe/trunk/lib/Rewrite/HTMLRewrite.cpp =================================================================== --- cfe/trunk/lib/Rewrite/HTMLRewrite.cpp +++ cfe/trunk/lib/Rewrite/HTMLRewrite.cpp @@ -342,6 +342,7 @@ " .CodeInsertionHint { font-weight: bold; background-color: #10dd10 }\n" " .CodeRemovalHint { background-color:#de1010 }\n" " .CodeRemovalHint { border-bottom:1px solid #6F9DBE }\n" + " .selected{ background-color:orange !important; }\n" " table.simpletable {\n" " padding: 5px;\n" " font-size:12pt;\n" Index: cfe/trunk/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp =================================================================== --- cfe/trunk/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp +++ cfe/trunk/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp @@ -91,6 +91,9 @@ // Rewrite the file specified by FID with HTML formatting. void RewriteFile(Rewriter &R, const SourceManager& SMgr, const PathPieces& path, FileID FID); + + /// \return Javascript for navigating the HTML report using j/k keys. + std::string generateKeyboardNavigationJavascript(); }; } // end anonymous namespace @@ -337,6 +340,9 @@ int LineNumber = path.back()->getLocation().asLocation().getExpansionLineNumber(); int ColumnNumber = path.back()->getLocation().asLocation().getExpansionColumnNumber(); + R.InsertTextBefore(SMgr.getLocForStartOfFile(FID), + generateKeyboardNavigationJavascript()); + // Add the name of the file as an

tag. { std::string s; @@ -378,8 +384,14 @@ os << "" << html::EscapeText(*I) << "\n"; } - os << "\n\n" - "

Annotated Source Code

\n"; + os << R"<<<( + + +

Annotated Source Code

+

[?] + Use j/k keys for keyboard navigation +

+)<<<"; R.InsertTextBefore(SMgr.getLocForStartOfFile(FID), os.str()); } @@ -777,3 +789,82 @@ html::HighlightRange(R, InstantiationStart, E, HighlightStart, HighlightEnd); } + +std::string HTMLDiagnostics::generateKeyboardNavigationJavascript() { + return R"<<<( + + )<<<"; +}