### 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)

placeholder_data_buf->clear();
	placeholder_data_buf->set_width(text.get_width());
	placeholder_data_buf->set_direction((TextServer::Direction)text_direction);
	placeholder_data_buf->set_preserve_control(draw_control_chars);
	placeholder_data_buf->add_string(placeholder_text, theme_cache.font, theme_cache.font_size, language);
	placeholder_bidi_override = structured_text_parser(st_parser, st_args, placeholder_text);
	if (placeholder_bidi_override.is_empty()) {
		TS->shaped_text_set_bidi_override(placeholder_data_buf->get_rid(), placeholder_bidi_override);
	}
	if (get_tab_size() > 0) {
		Vector<float> tabs;
		tabs.push_back(theme_cache.font->get_char_size(' ', theme_cache.font_size).width * get_tab_size());
		placeholder_data_buf->tab_align(tabs);
	}
	
	const int wrap_amount = placeholder_data_buf->get_line_count() - 1;
	placeholder_line_height = theme_cache.font->get_height(theme_cache.font_size);
	for (int i = 0; i <= wrap_amount; i++) {
		placeholder_line_height = MAX(placeholder_line_height, placeholder_data_buf->get_line_size(i).y);
	}
	
	placeholder_max_width = placeholder_data_buf->get_size().x;
	
	placeholder_wraped_rows.clear();
	for (int i = 0; i <= wrap_amount; i++) {
		Vector2i line_range = placeholder_data_buf->get_line_range(i);
		placeholder_wraped_rows.push_back(placeholder_text.substr(line_range.x, line_range.y - line_range.x));
	}
}
void TextEdit::_update_theme_item_cache() {