fix bug that matched patterns are not all highlighted.