### Godot version

4.0 stable

### System information

Manjaro Linux, kernel 6.1.1-1-MANJARO, AMD Ryzen 5 3600, AMD RX 580

### Issue description

The `wrap_mode` property of the `TextEdit` node doesn't seem to really do anything. Setting it to `LINE_WRAPPING_BOUNDARY` simply means that there won't be an horizontal scrollbar if the text overshoots the boundary, instead of actually forcing the text to the next line so that it stays visible.

### Steps to reproduce

Create a TextEdit node and set its `wrap_mode` property to `LINE_WRAPPING_BOUNDARY`

### Minimal reproduction project

[WrapBugDemo.zip](https://github.com/godotengine/godot/files/10875969/WrapBugDemo.zip)

if (p_from_line == p_to_line) {
		return;
	}
	bool dirty_height = false;
	bool dirty_width = false;
	for (int i = p_from_line; i < p_to_line; i++) {
		if (!dirty_height && text[i].height == line_height) {
			dirty_height = true;
		}
		if (!dirty_width && text[i].width == max_width) {
			dirty_width = true;
		}
		if (dirty_height && dirty_width) {
			break;
		}
	}
	int diff = (p_to_line - p_from_line);
	for (int i = p_to_line; i < text.size() - 1; i++) {
		text.write[(i - diff) + 1] = text[i + 1];
	}
	text.resize(text.size() - diff);
	if (dirty_height) {
		_calculate_line_height();
	}
	if (dirty_width) {
		_calculate_max_line_width();
	}
}
void TextEdit::Text::add_gutter(int p_at) {