Add tests for the grep view

This also fixes an off-by-one error in how the line numbers are
displayed and shows a message if no match is found.