core: clear whole line before displaying content instead of clearing after the end of content (bug #40115)