when switching to a new block where current line is the last line, set current line to first line instead