### Godot version

8449592d92eaeef990f5502b419d491ee3eeb7a6

### System information

Windows 11

### Issue description

Zooming in the script editor on an empty script freezes the entire editor for a few seconds, but if the file is large then it freezes for 4-5 seconds (which is unacceptable). Looks like a recent regression.

### Steps to reproduce

Just zoom in/out on the large script file.

### Minimal reproduction project

N/A
word_length = 0;
		} else if (c == 0xfffc) {
			continue;
		} else if ((u_ispunct(c) && c != 0x005F) || is_underscore(c) || c == '\t' || is_whitespace(c)) {
			// A whitespace ends current word.
			if (word_length > 0) {
				line_end = i - 1;
				word_start = -1;
				word_length = 0;
			}
		} else if (breaks.has(i)) {
			// End current word, no space.
			if (word_length > 0) {
				line_end = i;
				word_start = i + 1;
				word_length = 0;
			}
			if (p_chars_per_line <= 0) {
				ret.push_back(line_start);
				);
				line_start = word_start;
				line_end = line_start;
			}
		} else {
			if (word_start == -1) {
				word_start = i;
				if (p_chars_per_line <= 0) {
					ret.push_back(line_start);
					);
					line_start = word_start;