Otherwise the diagnostic view current index keeps shifting to the first diagnostic found for the line. (cherry picked from commit 658ca392)