Fix bug #6462 (Go to First Error/Warning command broken)

Fix bug #6462 - Screen out header sections (even invisible ones) when looking for first clickable row in results table.
With unit tests.

Speaking of linting, also fixes two whitespace errors in DocumentCommandHandlers.