Fix a bug that led to log windows being blanked by keeping track of how many lines are in each segment