Fix the LineCount issue when text is changed.